Code

Ticket #19296: patch.diff

File patch.diff, 771 bytes (added by pegler, 20 months ago)

patch to also support spatialite

Line 
1diff --git a/django/test/testcases.py b/django/test/testcases.py
2index 1239275..ec1f78a 100644
3--- a/django/test/testcases.py
4+++ b/django/test/testcases.py
5@@ -1077,7 +1077,7 @@ class LiveServerTestCase(TransactionTestCase):
6         for conn in connections.all():
7             # If using in-memory sqlite databases, pass the connections to
8             # the server thread.
9-            if (conn.settings_dict['ENGINE'] == 'django.db.backends.sqlite3'
10+            if (conn.settings_dict['ENGINE'] in ('django.db.backends.sqlite3', 'django.contrib.gis.db.backends.spatialite')
11                 and conn.settings_dict['NAME'] == ':memory:'):
12                 # Explicitly enable thread-shareability for this connection
13                 conn.allow_thread_sharing = True
14