summaryrefslogtreecommitdiff
path: root/tests/regressiontests/test_runner/tests.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-01-04 13:55:20 +0100
committerClaude Paroz <claude@2xlibre.net>2013-01-04 14:03:55 +0100
commit96301d21bb2ec7c5e06e3cea54fa2cdcd25a464d (patch)
tree874e62a661c1e9a8a67633cf69c0c7770d4f0199 /tests/regressiontests/test_runner/tests.py
parentb641357a37528c39de0c181ad495cbd39f3bf530 (diff)
[1.5.x] Fixed #19192 -- Allowed running tests with dummy db backend
Thanks Simon Charette for the initial patch, and Jan Bednařík for his work on the ticket. Backport of b740da3504 from master.
Diffstat (limited to 'tests/regressiontests/test_runner/tests.py')
-rw-r--r--tests/regressiontests/test_runner/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/test_runner/tests.py b/tests/regressiontests/test_runner/tests.py
index c723f162a4..5ef4d5537d 100644
--- a/tests/regressiontests/test_runner/tests.py
+++ b/tests/regressiontests/test_runner/tests.py
@@ -261,6 +261,24 @@ class Sqlite3InMemoryTestDbs(unittest.TestCase):
db.connections = old_db_connections
+class DummyBackendTest(unittest.TestCase):
+ def test_setup_databases(self):
+ """
+ Test that setup_databases() doesn't fail with dummy database backend.
+ """
+ runner = DjangoTestSuiteRunner(verbosity=0)
+ old_db_connections = db.connections
+ try:
+ db.connections = db.ConnectionHandler({})
+ old_config = runner.setup_databases()
+ runner.teardown_databases(old_config)
+ except Exception as e:
+ self.fail("setup_databases/teardown_databases unexpectedly raised "
+ "an error: %s" % e)
+ finally:
+ db.connections = old_db_connections
+
+
class AutoIncrementResetTest(TransactionTestCase):
"""
Here we test creating the same model two times in different test methods,