Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/test/testcases.py
4  django/test/testcases.py
@@ -1077,7 +1077,7 @@ def setUpClass(cls):
1077 1077
         for conn in connections.all():
1078 1078
             # If using in-memory sqlite databases, pass the connections to
1079 1079
             # the server thread.
1080  
-            if (conn.settings_dict['ENGINE'] == 'django.db.backends.sqlite3'
  1080
+            if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
1081 1081
                 and conn.settings_dict['NAME'] == ':memory:'):
1082 1082
                 # Explicitly enable thread-shareability for this connection
1083 1083
                 conn.allow_thread_sharing = True
@@ -1129,7 +1129,7 @@ def tearDownClass(cls):
1129 1129
 
1130 1130
         # Restore sqlite connections' non-sharability
1131 1131
         for conn in connections.all():
1132  
-            if (conn.settings_dict['ENGINE'] == 'django.db.backends.sqlite3'
  1132
+            if (conn.settings_dict['ENGINE'].rsplit('.', 1)[-1] in ('sqlite3', 'spatialite')
1133 1133
                 and conn.settings_dict['NAME'] == ':memory:'):
1134 1134
                 conn.allow_thread_sharing = False
1135 1135
 

0 notes on commit ff0d312

Please sign in to comment.
Something went wrong with that request. Please try again.