Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19296 -- Applied test connection sharing for spatialite

Thanks pegler at gmail.com for the report and the initial patch.
  • Loading branch information...
commit ff0d3126afbc30ae1aab3a9d352300e59937fe5e 1 parent 7cfb567
Claude Paroz claudep authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/test/testcases.py
4 django/test/testcases.py
View
@@ -1077,7 +1077,7 @@ def setUpClass(cls):
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 @@ def tearDownClass(cls):
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.