summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-01-20 23:15:22 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-01-20 23:15:22 +0000
commit905e33f84a1a10e4f0183d879c52076ef876fc3b (patch)
tree490c16bc8d1d7e1128d325eb032110fcf4a259e2 /tests
parent477f4d80616392bbd3352cad50faedb9c1494b33 (diff)
Fixed #16885 -- Confirmed features of mirror databases when setting up test databases.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/test_runner/tests.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/regressiontests/test_runner/tests.py b/tests/regressiontests/test_runner/tests.py
index d19df3c725..bd3e40c13b 100644
--- a/tests/regressiontests/test_runner/tests.py
+++ b/tests/regressiontests/test_runner/tests.py
@@ -10,7 +10,7 @@ import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.test import simple
-from django.test.simple import get_tests
+from django.test.simple import DjangoTestSuiteRunner, get_tests
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils import unittest
from django.utils.importlib import import_module
@@ -214,6 +214,29 @@ class CustomTestRunnerOptionsTests(AdminScriptTestCase):
self.assertOutput(out, 'bar:foo:31337')
+class Ticket16885RegressionTests(unittest.TestCase):
+ def test_ticket_16885(self):
+ """Features are also confirmed on mirrored databases."""
+ from django import db
+ old_db_connections = db.connections
+ try:
+ db.connections = db.ConnectionHandler({
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ },
+ 'slave': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'TEST_MIRROR': 'default',
+ },
+ })
+ slave = db.connections['slave']
+ self.assertEqual(slave.features.supports_transactions, None)
+ DjangoTestSuiteRunner(verbosity=0).setup_databases()
+ self.assertNotEqual(slave.features.supports_transactions, None)
+ finally:
+ db.connections = old_db_connections
+
+
class Ticket17477RegressionTests(AdminScriptTestCase):
def setUp(self):
self.write_settings('settings.py')