Corrected the tests for DjangoTestRunner so they pass under Postgres.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11937 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-12-22 06:00:57 +00:00
parent 79d6e402e3
commit 15f42cc92a
1 changed files with 7 additions and 7 deletions

View File

@ -4,25 +4,25 @@ Tests for django test runner
import StringIO import StringIO
import unittest import unittest
import django import django
from django.test import TestCase, TransactionTestCase, simple from django.test import simple
class DjangoTestRunnerTests(unittest.TestCase):
class DjangoTestRunnerTests(TestCase):
def test_failfast(self): def test_failfast(self):
class MockTestOne(TransactionTestCase): class MockTestOne(unittest.TestCase):
def runTest(self): def runTest(self):
assert False assert False
class MockTestTwo(TransactionTestCase): class MockTestTwo(unittest.TestCase):
def runTest(self): def runTest(self):
assert False assert False
suite = unittest.TestSuite([MockTestOne(), MockTestTwo()]) suite = unittest.TestSuite([MockTestOne(), MockTestTwo()])
mock_stream = StringIO.StringIO() mock_stream = StringIO.StringIO()
dtr = simple.DjangoTestRunner(verbosity=0, failfast=False, stream=mock_stream) dtr = simple.DjangoTestRunner(verbosity=0, failfast=False, stream=mock_stream)
result = dtr.run(suite) result = dtr.run(suite)
self.assertEqual(2, result.testsRun) self.assertEqual(2, result.testsRun)
self.assertEqual(2, len(result.failures)) self.assertEqual(2, len(result.failures))
dtr = simple.DjangoTestRunner(verbosity=0, failfast=True, stream=mock_stream) dtr = simple.DjangoTestRunner(verbosity=0, failfast=True, stream=mock_stream)
result = dtr.run(suite) result = dtr.run(suite)
self.assertEqual(1, result.testsRun) self.assertEqual(1, result.testsRun)