Permalink
Browse files

Refs #5943, #6107 -- Added framework and tests to check for the corre…

…ct 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
  • Loading branch information...
1 parent 96a47da commit 9376d4ed5bd175eff87788ccf11e761fdef42b8b @freakboy3742 freakboy3742 committed Jul 10, 2008
@@ -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()))
+
@@ -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()))
@@ -0,0 +1,9 @@
+from django.core.management.base import LabelCommand
+
+class Command(LabelCommand):
+ help = "Test Label-based commands"
+ requires_model_validation = False
+ args = '<label>'
+
+ def handle_label(self, label, **options):
+ print 'EXECUTE:LabelCommand label=%s, options=%s' % (label, sorted(options.items()))
@@ -0,0 +1,9 @@
+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+ help = "Test No-args commands"
+ requires_model_validation = False
+
+
+ def handle_noargs(self, **options):
+ print 'EXECUTE:NoArgsCommand options=%s' % sorted(options.items())
@@ -0,0 +1,12 @@
+from django.db import models
+
+class Article(models.Model):
+ headline = models.CharField(max_length=100, default='Default headline')
+ pub_date = models.DateTimeField()
+
+ def __unicode__(self):
+ return self.headline
+
+ class Meta:
+ ordering = ('-pub_date', 'headline')
+
Oops, something went wrong. Retry.

0 comments on commit 9376d4e

Please sign in to comment.