summaryrefslogtreecommitdiff
path: root/tests/test_runner
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2013-06-14 15:02:30 +0100
committerMarc Tamlyn <marc.tamlyn@gmail.com>2013-06-14 15:37:39 +0100
commit46789e76c68b5713795fbf71ce5fdccb727074fa (patch)
treee5ebddf35699361a0324151e3b7134563a859bab /tests/test_runner
parent5459795ef224c5c81461c06a95d38390ee91f014 (diff)
Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suite
Diffstat (limited to 'tests/test_runner')
-rw-r--r--tests/test_runner/tests.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py
index 74a557af26..03a3619c7e 100644
--- a/tests/test_runner/tests.py
+++ b/tests/test_runner/tests.py
@@ -10,8 +10,8 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django import db
from django.test import runner, TransactionTestCase, skipUnlessDBFeature
-from django.test.simple import DjangoTestSuiteRunner, get_tests
from django.test.testcases import connections_support_transactions
+from django.test.utils import IgnorePendingDeprecationWarningsMixin
from django.utils import unittest
from django.utils.importlib import import_module
@@ -225,15 +225,17 @@ class Ticket17477RegressionTests(AdminScriptTestCase):
self.assertNoOutput(err)
-class ModulesTestsPackages(unittest.TestCase):
+class ModulesTestsPackages(IgnorePendingDeprecationWarningsMixin, unittest.TestCase):
def test_get_tests(self):
"Check that the get_tests helper function can find tests in a directory"
+ from django.test.simple import get_tests
module = import_module(TEST_APP_OK)
tests = get_tests(module)
self.assertIsInstance(tests, type(module))
def test_import_error(self):
"Test for #12658 - Tests with ImportError's shouldn't fail silently"
+ from django.test.simple import get_tests
module = import_module(TEST_APP_ERROR)
self.assertRaises(ImportError, get_tests, module)
@@ -258,7 +260,7 @@ class Sqlite3InMemoryTestDbs(unittest.TestCase):
},
})
other = db.connections['other']
- DjangoTestSuiteRunner(verbosity=0).setup_databases()
+ runner.DiscoverRunner(verbosity=0).setup_databases()
msg = "DATABASES setting '%s' option set to sqlite3's ':memory:' value shouldn't interfere with transaction support detection." % option
# Transaction support should be properly initialised for the 'other' DB
self.assertTrue(other.features.supports_transactions, msg)
@@ -273,12 +275,12 @@ class DummyBackendTest(unittest.TestCase):
"""
Test that setup_databases() doesn't fail with dummy database backend.
"""
- runner = DjangoTestSuiteRunner(verbosity=0)
+ runner_instance = runner.DiscoverRunner(verbosity=0)
old_db_connections = db.connections
try:
db.connections = db.ConnectionHandler({})
- old_config = runner.setup_databases()
- runner.teardown_databases(old_config)
+ old_config = runner_instance.setup_databases()
+ runner_instance.teardown_databases(old_config)
except Exception as e:
self.fail("setup_databases/teardown_databases unexpectedly raised "
"an error: %s" % e)