override_system_checks
Act as a decorator. Override list of registered system checks. Useful when you override INSTALLED_APPS, e.g. if you exclude auth app, you also need to exclude its system checks.
Attributes
| Attribute | Type | Description |
|---|---|---|
| registry | [CheckRegistry](../../../../core/checks/registry/checkregistry.md?sid=django_core_checks_registry_checkregistry) | The Django system check registry instance used to manage and trigger validation checks. |
| new_checks | iterable | A collection of check functions to be registered as the active system checks during the test context. |
| deployment_checks | iterable = None | An optional collection of check functions to override the active deployment-specific system checks. |
| old_checks | set | A backup of the original registered checks used to restore the registry state after the decorator exits. |
| old_deployment_checks | set | A backup of the original deployment checks used to restore the registry state after the decorator exits. |
Constructor
Signature
def override_system_checks(
new_checks: list,
deployment_checks: list = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| new_checks | list | The collection of system checks to be registered. |
| deployment_checks | list = None | An optional collection of deployment-specific checks to be registered. |
Signature
def override_system_checks(
new_checks: list,
deployment_checks: list = None
)
Parameters
| Name | Type | Description |
|---|---|---|
| new_checks | list | The collection of standard system check functions to register in the global registry. |
| deployment_checks | list = None | The collection of deployment-specific check functions to register; if omitted, deployment checks are not modified. |
Methods
enable()
@classmethod
def enable()
Backs up the current registered system checks and replaces them with the user-defined set provided to the decorator.
disable()
@classmethod
def disable()
Restores the original system checks and deployment checks to the global registry that were present before the decorator was enabled.