summaryrefslogtreecommitdiff
path: root/tests/delete_regress
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-09-07 22:10:31 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-09-09 23:03:51 +0200
commit05cea7fdbbcd7bdcdc8d8162d95b1dd5d8195913 (patch)
treedebff1c4693e9a18ea3472f41603da207a449101 /tests/delete_regress
parente8b49d4cc4056716195f16963c9bb57e87952e0b (diff)
Changed database connection duplication technique.
This new technique is more straightforward and compatible with test parallelization, where the effective database connection settings no longer match settings.DATABASES.
Diffstat (limited to 'tests/delete_regress')
-rw-r--r--tests/delete_regress/tests.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/delete_regress/tests.py b/tests/delete_regress/tests.py
index 7cbd94f427..2128733798 100644
--- a/tests/delete_regress/tests.py
+++ b/tests/delete_regress/tests.py
@@ -2,9 +2,7 @@ from __future__ import unicode_literals
import datetime
-from django.conf import settings
-from django.db import DEFAULT_DB_ALIAS, models, transaction
-from django.db.utils import ConnectionHandler
+from django.db import connection, models, transaction
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import (
@@ -24,8 +22,7 @@ class DeleteLockingTest(TransactionTestCase):
def setUp(self):
# Create a second connection to the default database
- new_connections = ConnectionHandler(settings.DATABASES)
- self.conn2 = new_connections[DEFAULT_DB_ALIAS]
+ self.conn2 = connection.copy()
self.conn2.set_autocommit(False)
def tearDown(self):