From 9376d4ed5bd175eff87788ccf11e761fdef42b8b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 10 Jul 2008 12:12:41 +0000 Subject: [PATCH] Refs #5943, #6107 -- Added framework and tests to check for the correct operation of django-admin and manage.py. Thanks for Simon Willison and Karen Tracey for their contributions and assistance testing this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7876 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../regressiontests/admin_scripts/__init__.py | 0 .../admin_scripts/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/app_command.py | 10 + .../management/commands/base_command.py | 9 + .../management/commands/label_command.py | 9 + .../management/commands/noargs_command.py | 9 + tests/regressiontests/admin_scripts/models.py | 12 + tests/regressiontests/admin_scripts/tests.py | 813 ++++++++++++++++++ 9 files changed, 862 insertions(+) create mode 100644 tests/regressiontests/admin_scripts/__init__.py create mode 100644 tests/regressiontests/admin_scripts/management/__init__.py create mode 100644 tests/regressiontests/admin_scripts/management/commands/__init__.py create mode 100644 tests/regressiontests/admin_scripts/management/commands/app_command.py create mode 100644 tests/regressiontests/admin_scripts/management/commands/base_command.py create mode 100644 tests/regressiontests/admin_scripts/management/commands/label_command.py create mode 100644 tests/regressiontests/admin_scripts/management/commands/noargs_command.py create mode 100644 tests/regressiontests/admin_scripts/models.py create mode 100644 tests/regressiontests/admin_scripts/tests.py diff --git a/tests/regressiontests/admin_scripts/__init__.py b/tests/regressiontests/admin_scripts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/admin_scripts/management/__init__.py b/tests/regressiontests/admin_scripts/management/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/admin_scripts/management/commands/__init__.py b/tests/regressiontests/admin_scripts/management/commands/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/admin_scripts/management/commands/app_command.py b/tests/regressiontests/admin_scripts/management/commands/app_command.py new file mode 100644 index 0000000000..f72e912ac0 --- /dev/null +++ b/tests/regressiontests/admin_scripts/management/commands/app_command.py @@ -0,0 +1,10 @@ +from django.core.management.base import AppCommand + +class Command(AppCommand): + help = 'Test Application-based commands' + requires_model_validation = False + args = '[appname ...]' + + def handle_app(self, app, **options): + print 'EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items())) + diff --git a/tests/regressiontests/admin_scripts/management/commands/base_command.py b/tests/regressiontests/admin_scripts/management/commands/base_command.py new file mode 100644 index 0000000000..0187a23b29 --- /dev/null +++ b/tests/regressiontests/admin_scripts/management/commands/base_command.py @@ -0,0 +1,9 @@ +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + help = 'Test basic commands' + requires_model_validation = False + args = '[labels ...]' + + def handle(self, *labels, **options): + print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items())) diff --git a/tests/regressiontests/admin_scripts/management/commands/label_command.py b/tests/regressiontests/admin_scripts/management/commands/label_command.py new file mode 100644 index 0000000000..2b735c8e60 --- /dev/null +++ b/tests/regressiontests/admin_scripts/management/commands/label_command.py @@ -0,0 +1,9 @@ +from django.core.management.base import LabelCommand + +class Command(LabelCommand): + help = "Test Label-based commands" + requires_model_validation = False + args = '