'The default connection (i.e. django.db.connection) is different for
each thread (#17258).'

def test_default_connection_thread_local(self):

    connections_dict = {}
    connection.cursor()
    connections_dict[id(connection)] = connection
    def runner():
        from django.db import connections
        connection = connections[DEFAULT_DB_ALIAS]
        connection.allow_thread_sharing = True
        connection.cursor()
        connections_dict[id(connection)] = connection
    for x in range(2):
        t = threading.Thread(target=runner)
        t.start()
        t.join()
    self.assertEqual(len({conn.connection for conn in connections_dict.values()}), 3)
    for conn in connections_dict.values():
        if (conn is not connection):
            conn.close()
