diff options
Diffstat (limited to 'tests/admin_scripts/management')
5 files changed, 15 insertions, 4 deletions
diff --git a/tests/admin_scripts/management/commands/app_command.py b/tests/admin_scripts/management/commands/app_command.py index 4706645484..f0981eba2d 100644 --- a/tests/admin_scripts/management/commands/app_command.py +++ b/tests/admin_scripts/management/commands/app_command.py @@ -3,7 +3,7 @@ from django.core.management.base import AppCommand class Command(AppCommand): help = 'Test Application-based commands' - requires_model_validation = False + requires_system_checks = False args = '[app_label ...]' def handle_app_config(self, app_config, **options): diff --git a/tests/admin_scripts/management/commands/base_command.py b/tests/admin_scripts/management/commands/base_command.py index 6e37ca238e..c313235ead 100644 --- a/tests/admin_scripts/management/commands/base_command.py +++ b/tests/admin_scripts/management/commands/base_command.py @@ -10,7 +10,7 @@ class Command(BaseCommand): make_option('--option_c', '-c', action='store', dest='option_c', default='3'), ) help = 'Test basic commands' - requires_model_validation = False + requires_system_checks = False args = '[labels ...]' def handle(self, *labels, **options): diff --git a/tests/admin_scripts/management/commands/label_command.py b/tests/admin_scripts/management/commands/label_command.py index 3bce1305bc..9bba413ff3 100644 --- a/tests/admin_scripts/management/commands/label_command.py +++ b/tests/admin_scripts/management/commands/label_command.py @@ -3,7 +3,7 @@ from django.core.management.base import LabelCommand class Command(LabelCommand): help = "Test Label-based commands" - requires_model_validation = False + requires_system_checks = False args = '<label>' def handle_label(self, label, **options): diff --git a/tests/admin_scripts/management/commands/noargs_command.py b/tests/admin_scripts/management/commands/noargs_command.py index e94807f2e2..3a75098c71 100644 --- a/tests/admin_scripts/management/commands/noargs_command.py +++ b/tests/admin_scripts/management/commands/noargs_command.py @@ -3,7 +3,7 @@ from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Test No-args commands" - requires_model_validation = False + requires_system_checks = False def handle_noargs(self, **options): print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items())) diff --git a/tests/admin_scripts/management/commands/validation_command.py b/tests/admin_scripts/management/commands/validation_command.py new file mode 100644 index 0000000000..e9ba86dc6c --- /dev/null +++ b/tests/admin_scripts/management/commands/validation_command.py @@ -0,0 +1,11 @@ +from django.core.management.base import NoArgsCommand + + +class InvalidCommand(NoArgsCommand): + help = ("Test raising an error if both requires_system_checks " + "and requires_model_validation are defined.") + requires_system_checks = True + requires_model_validation = True + + def handle_noargs(self, **options): + pass |
