- Implement tests for web forms screen to ensure proper rendering and behavior on different devices. - Create unit tests for web form model to validate JSON serialization and deserialization. - Add tests for web forms provider to verify API interactions and state management. - Ensure that publishing rules and field validations are correctly enforced in the tests.
21 lines
786 B
Python
21 lines
786 B
Python
from django.apps import AppConfig
|
|
|
|
|
|
class WebFormsConfig(AppConfig):
|
|
name = "webforms"
|
|
default_auto_field = "django.db.models.BigAutoField"
|
|
|
|
def ready(self):
|
|
# Imported here rather than at module scope: `ready()` is the first
|
|
# point at which the app registry is populated, and webforms.cors
|
|
# imports a model.
|
|
#
|
|
# Connecting this is what makes the per-form CORS rule take effect at
|
|
# all. A correct receiver that nobody calls is the same as no receiver,
|
|
# which is why `test_the_receiver_is_registered_with_corsheaders`
|
|
# exists.
|
|
from corsheaders.signals import check_request_enabled
|
|
|
|
from webforms.cors import allow_webform_origin
|
|
|
|
check_request_enabled.connect(allow_webform_origin)
|