Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #6168 -- Updated the Django system test runner to make it possi…

…ble to run the invalid_models test (and any other invalid_ test) explicitly, rather than just as part of the full suite. Thanks for tracking down the problem, Eric Florenzano.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7576 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d234e92740ed6c144f222f15afe33c49fb49d7b7 1 parent ed1c211
Russell Keith-Magee authored June 06, 2008

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  tests/runtests.py
9  tests/runtests.py
@@ -118,7 +118,6 @@ def django_tests(verbosity, interactive, test_labels):
118 118
     get_apps()
119 119
 
120 120
     # Load all the test model apps.
121  
-    test_models = []
122 121
     for model_dir, model_name in get_test_models():
123 122
         model_label = '.'.join([model_dir, model_name])
124 123
         try:
@@ -142,7 +141,13 @@ def django_tests(verbosity, interactive, test_labels):
142 141
         model_label = '.'.join([model_dir, model_name])
143 142
         if not test_labels or model_name in test_labels:
144 143
             extra_tests.append(InvalidModelTestCase(model_label))
145  
-
  144
+            try:
  145
+                # Invalid models are not working apps, so we cannot pass them into 
  146
+                # the test runner with the other test_labels
  147
+                test_labels.remove(model_name)
  148
+            except ValueError:
  149
+                pass
  150
+    
146 151
     # Run the test suite, including the extra validation tests.
147 152
     from django.test.simple import run_tests
148 153
     failures = run_tests(test_labels, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests)

0 notes on commit d234e92

Please sign in to comment.
Something went wrong with that request. Please try again.