Permalink
Browse files

Simplified testing connection type

  • Loading branch information...
1 parent 550b619 commit b96f3043a69bec4803d0c5cd84d3107c1ea94fa5 @claudep claudep committed Jul 9, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/test/testcases.py
@@ -1128,7 +1128,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'].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 @@ def tearDownClass(cls):
# 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

0 comments on commit b96f304

Please sign in to comment.