django/tests/backends/base
Matthijs Kooijman b64b1b2e1a 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().
2020-01-20 11:00:17 +01:00
..
__init__.py Reorganized backends tests. 2017-06-21 12:00:47 -04:00
test_base.py Refs #28595 -- Added a hook to add execute wrappers for database queries. 2017-09-21 12:13:09 -04:00
test_creation.py Fixed #31117 -- Isolated backends.base.test_creation.TestDbCreationTests. 2020-01-20 11:00:17 +01:00
test_features.py Switched TestCase to SimpleTestCase where possible in Django's tests. 2018-11-27 08:58:44 -05:00
test_operations.py Fixed typos in docs, comments, and exception messages. 2019-04-18 09:33:53 +02:00
test_schema.py Added BaseDatabaseSchemaEditor._effective_default() to allow testing without a connection. 2018-11-17 19:27:53 -05:00