Commit e8b49d4c authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Propagated database clone settings to new connections.

parent 0bd58e0e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -233,7 +233,11 @@ def _init_worker(counter):
    for alias in connections:
        connection = connections[alias]
        settings_dict = connection.creation.get_test_db_clone_settings(_worker_id)
        connection.settings_dict = settings_dict
        # connection.settings_dict must be updated in place for changes to be
        # reflected in django.db.connections. If the following line assigned
        # connection.settings_dict = settings_dict, new threads would connect
        # to the default database instead of the appropriate clone.
        connection.settings_dict.update(settings_dict)
        connection.close()