summaryrefslogtreecommitdiff
path: root/tests/backends/base/test_creation.py
AgeCommit message (Collapse)Author
2026-01-14Fixed #35402 -- Fixed crash in DatabaseFeatures.django_test_skips when ↵Jacob Walls
running a subset of tests. Thanks Tim Graham for the report and the review.
2026-01-03Added DatabaseCreation.destroy_test_db_connection_close_method hook.Tim Graham
2025-02-16Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).Simon Charette
Given there are no longer any internal usages of serialize=True and it poses a risk to non-test databases integrity it seems appropriate to deprecate it.
2024-02-20Fixed #35238 -- Fixed database serialization crash when base managers use ↵AlexCLeduc
prefetch_related(). Regression in 139135627650ed6aaaf4c755b82c3bd43f2b8f51 following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-12-30Fixed #23273 -- Avoided creation of django_migrations table when there are ↵Jacob Walls
no migrations to apply.
2020-12-11Refs #32178 -- Fixed test_mark_expected_failures_and_skips_call teardown.Tim Graham
Test isolation failure observed on CockroachDB and PostgreSQL.
2020-12-10Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani
failures. Co-authored-by: Tim Graham <timograham@gmail.com>
2020-11-11Fixed #31762 -- Made reloading the database for tests use the base manager.Hasan Ramezani
Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
2020-09-23Fixed #32012 -- Made test database creation sync apps models when migrations ↵Mariusz Felisiak
are disabled. Thanks Jaap Roes for the report.
2020-04-02Refs #31051 -- Fixed reloading the database with circular related objects ↵Matthijs Kooijman
and natural keys for tests. Made deserialize_db_from_string() do not sort dependencies. deserialize_db_from_string() doesn't use natural keys, so there is no need to sort dependencies in serialize_db_to_string(). Moreover, sorting models cause issues for circular dependencies.
2020-04-02Refs #26552 -- Added test for reloading the database with self-referential ↵Matthijs Kooijman
objects.
2020-02-19Fixed tests when run in reverse.Mariusz Felisiak
Regression in 98f23a8af0be7e87535426c5c83058e2682bfdf8.
2020-02-14Fixed #26552 -- Deferred constraint checks when reloading the database with ↵Matthijs Kooijman
data for tests. deserialize_db_from_string() loads the full serialized database contents, which might contain forward references and cycles. That caused IntegrityError because constraints were checked immediately. Now, it loads data in a transaction with constraint checks deferred until the end of the transaction.
2020-01-20Fixed #31117 -- Isolated backends.base.test_creation.TestDbCreationTests.Matthijs Kooijman
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-20Refs #31117 -- Moved get_connection_copy() test hook to a module level.Mariusz Felisiak
2019-11-20Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Jon Dufresne
database creation.
2017-06-21Reorganized backends tests.Mariusz Felisiak