mirror of
https://github.com/Hopiu/django.git
synced 2026-04-05 23:51:05 +00:00
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(). |
||
|---|---|---|
| .. | ||
| base | ||
| mysql | ||
| oracle | ||
| postgresql | ||
| sqlite | ||
| __init__.py | ||
| models.py | ||
| test_ddl_references.py | ||
| test_utils.py | ||
| tests.py | ||