summaryrefslogtreecommitdiff
path: root/tests/admin_scripts/management
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2014-01-20 10:45:21 +0800
committerRussell Keith-Magee <russell@keith-magee.com>2014-01-20 10:45:21 +0800
commitd818e0c9b2b88276cc499974f9eee893170bf0a8 (patch)
tree13ef631f7ba50bf81fa36f484abf925ba8172651 /tests/admin_scripts/management
parent6e7bd0b63bd01949ac4fd647f2597639bed0c3a2 (diff)
downloaddjango-d818e0c9b2b88276cc499974f9eee893170bf0a8.tar.gz
Fixed #16905 -- Added extensible checks (nee validation) framework
This is the result of Christopher Medrela's 2013 Summer of Code project. Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian Apolloner, and Alex Gaynor for review notes along the way. Also: Fixes #8579, fixes #3055, fixes #19844.
Diffstat (limited to 'tests/admin_scripts/management')
-rw-r--r--tests/admin_scripts/management/commands/app_command.py2
-rw-r--r--tests/admin_scripts/management/commands/base_command.py2
-rw-r--r--tests/admin_scripts/management/commands/label_command.py2
-rw-r--r--tests/admin_scripts/management/commands/noargs_command.py2
-rw-r--r--tests/admin_scripts/management/commands/validation_command.py11
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