diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2020-01-18 19:59:56 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-20 11:00:17 +0100 |
commit | b64b1b2e1a17da3fd702cde4bfc2b6e0689b4348 (patch) | |
tree | 0f646d144291d553b7159036ab544a83e9fc6538 /django/db/backends/postgresql/operations.py | |
parent | f34be5294d8bd9530079525fb56e661816a63e20 (diff) | |
download | django-b64b1b2e1a17da3fd702cde4bfc2b6e0689b4348.tar.gz |
Fixed #31117 -- Isolated backends.base.test_creation.TestDbCreationTests.
Previously, this test could modify global state by changing
connection.settings_dict. This dict is a reference to the same dict as
django.db.connections.databases['default'], which is thus also changed.
The cleanup of this test would replace connection.settings_dic` with a
saved copy, which would leave the dict itself modified.
Additionally, create_test_db() would also modify these same dicts, as
well as settings.databases['default']['NAME'] by adding a "test_"
prefix, which is what can cause problems later.
This patch:
- makes a complete copy of the connection and work on that, to improve
isolation.
- calls destroy_test_db() to let that code clean up anything done by
create_test_db().
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
0 files changed, 0 insertions, 0 deletions