Commit b96f3043 authored by Claude Paroz's avatar Claude Paroz
Browse files

Simplified testing connection type

parent 550b6195
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1128,7 +1128,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'].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 @@ class LiveServerTestCase(TransactionTestCase):

        # 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