summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-07-09 19:47:47 +0200
committerClaude Paroz <claude@2xlibre.net>2013-07-09 19:47:57 +0200
commitb96f3043a69bec4803d0c5cd84d3107c1ea94fa5 (patch)
treeab8e4a1985b5cb24650099784d7828bece1c5be6
parent550b6195edf547ca821f578341a78d68d4121551 (diff)
Simplified testing connection type
-rw-r--r--django/test/testcases.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index c5299bdabc..04d044de27 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1128,7 +1128,7 @@ class LiveServerTestCase(TransactionTestCase):
for conn in connections.all():
# If using in-memory sqlite databases, pass the connections to
# the server thread.
- if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
+ if (conn.vendor == 'sqlite'
and conn.settings_dict['NAME'] == ':memory:'):
# Explicitly enable thread-shareability for this connection
conn.allow_thread_sharing = True
@@ -1180,7 +1180,7 @@ class LiveServerTestCase(TransactionTestCase):
# Restore sqlite connections' non-sharability
for conn in connections.all():
- if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
+ if (conn.vendor == 'sqlite'
and conn.settings_dict['NAME'] == ':memory:'):
conn.allow_thread_sharing = False