Permalink
Browse files

Added test ordering to the django test runner, so it behaves the same…

… way as the original.
  • Loading branch information...
1 parent ced7eec commit 531f2683b9834ce42864db96051ed9593a57b785 lukasz committed Aug 9, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/xmlrunner/extra/djangotestrunner.py
@@ -16,7 +16,10 @@
from django.db.models import get_app, get_apps
from django.test.utils import setup_test_environment, teardown_test_environment
-from django.test.simple import build_suite, build_test, DjangoTestSuiteRunner
+from django.test.simple import (
+ build_suite, build_test, DjangoTestSuiteRunner, reorder_suite
+)
+from django.test.testcases import TestCase
import xmlrunner
class XMLTestRunner(DjangoTestSuiteRunner):
@@ -63,6 +66,8 @@ def run_tests(self, test_labels, verbosity=1, interactive=True, extra_tests=[]):
for test in extra_tests:
suite.addTest(test)
+ suite = reorder_suite(suite, (TestCase,))
+
old_config = self.setup_databases()
result = xmlrunner.XMLTestRunner(

0 comments on commit 531f268

Please sign in to comment.