summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-11-16 14:25:45 +0100
committerClaude Paroz <claude@2xlibre.net>2012-11-16 14:33:59 +0100
commitb39b0aedbfbddf8fab0c43b92dc237caa8da375f (patch)
treebe5bca38a4df39187cc74b84e1af2f80f41869d4
parenta1fd9555f2cc32d10cdbc4aa71f86bac50ffd9c1 (diff)
[1.5.x] Fixed #19296 -- Applied test connection sharing for spatialite
Thanks pegler at gmail.com for the report and the initial patch. Backport of ff0d3126af from master.
-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 1239275264..96178b4c86 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1077,7 +1077,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'] == 'django.db.backends.sqlite3'
+ if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
and conn.settings_dict['NAME'] == ':memory:'):
# Explicitly enable thread-shareability for this connection
conn.allow_thread_sharing = True
@@ -1129,7 +1129,7 @@ class LiveServerTestCase(TransactionTestCase):
# Restore sqlite connections' non-sharability
for conn in connections.all():
- if (conn.settings_dict['ENGINE'] == 'django.db.backends.sqlite3'
+ if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
and conn.settings_dict['NAME'] == ':memory:'):
conn.allow_thread_sharing = False