Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added tet runner tests mistakenly left out of r11843. Refs #11613.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4b0f9531eb252a328d1041a5e2e4daab22b7bccc 1 parent 0fe8c20
@kmtracey kmtracey authored
View
0  tests/regressiontests/test_runner/__init__.py
No changes.
View
0  tests/regressiontests/test_runner/models.py
No changes.
View
29 tests/regressiontests/test_runner/tests.py
@@ -0,0 +1,29 @@
+"""
+Tests for django test runner
+"""
+import StringIO
+import unittest
+import django
+from django.test import TestCase, TransactionTestCase, simple
+
+class DjangoTestRunnerTests(TestCase):
+
+ def test_failfast(self):
+ class MockTestOne(TransactionTestCase):
+ def runTest(self):
+ assert False
+ class MockTestTwo(TransactionTestCase):
+ def runTest(self):
+ assert False
+
+ suite = unittest.TestSuite([MockTestOne(), MockTestTwo()])
+ mock_stream = StringIO.StringIO()
+ dtr = simple.DjangoTestRunner(verbosity=0, failfast=False, stream=mock_stream)
+ result = dtr.run(suite)
+ self.assertEqual(2, result.testsRun)
+ self.assertEqual(2, len(result.failures))
+
+ dtr = simple.DjangoTestRunner(verbosity=0, failfast=True, stream=mock_stream)
+ result = dtr.run(suite)
+ self.assertEqual(1, result.testsRun)
+ self.assertEqual(1, len(result.failures))
Please sign in to comment.
Something went wrong with that request. Please try again.