summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2024-12-17 23:38:23 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2025-02-16 08:43:42 +0100
commit2d34ebe49a25d0974392583d5bbd954baf742a32 (patch)
tree2d1803e68dadb701615094010310081b6ea9fd23 /docs
parent99ac8e2589ea978c1c80ff66b4536814121f77dd (diff)
Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/releases/6.0.txt6
-rw-r--r--docs/topics/testing/advanced.txt15
3 files changed, 15 insertions, 9 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index e29c554f95..0a8ccaa20a 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -15,6 +15,9 @@ about each item can often be found in the release notes of two versions prior.
See the :ref:`Django 6.0 release notes <deprecated-features-6.0>` for more
details on these changes.
+* The ``serialize`` keyword argument of
+ ``BaseDatabaseCreation.create_test_db()`` will be removed.
+
.. _deprecation-removed-in-6.1:
6.1
diff --git a/docs/releases/6.0.txt b/docs/releases/6.0.txt
index 4e5f3c1f02..abc56e6886 100644
--- a/docs/releases/6.0.txt
+++ b/docs/releases/6.0.txt
@@ -235,7 +235,8 @@ Database backend API
This section describes changes that may be needed in third-party database
backends.
-* ...
+* ``BaseDatabaseCreation.create_test_db(serialize)`` is deprecated. Use
+ ``serialize_db_to_string()`` instead.
Dropped support for MariaDB 10.5
--------------------------------
@@ -278,7 +279,8 @@ Features deprecated in 6.0
Miscellaneous
-------------
-* ...
+* ``BaseDatabaseCreation.create_test_db(serialize)`` is deprecated. Use
+ ``serialize_db_to_string()`` instead.
Features removed in 6.0
=======================
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
index c2d1fc6c6e..79d3f97f48 100644
--- a/docs/topics/testing/advanced.txt
+++ b/docs/topics/testing/advanced.txt
@@ -796,7 +796,7 @@ utility methods in the ``django.test.utils`` module.
The creation module of the database backend also provides some utilities that
can be useful during testing.
-.. function:: create_test_db(verbosity=1, autoclobber=False, serialize=True, keepdb=False)
+.. function:: create_test_db(verbosity=1, autoclobber=False, keepdb=False)
Creates a new test database and runs ``migrate`` against it.
@@ -812,12 +812,6 @@ can be useful during testing.
* If ``autoclobber`` is ``True``, the database will be destroyed
without consulting the user.
- ``serialize`` determines if Django serializes the database into an
- in-memory JSON string before running tests (used to restore the database
- state between tests if you don't have transactions). You can set this to
- ``False`` to speed up creation time if you don't have any test classes
- with :ref:`serialized_rollback=True <test-case-serialized-rollback>`.
-
``keepdb`` determines if the test run should use an existing
database, or create a new one. If ``True``, the existing
database will be used, or created if not present. If ``False``,
@@ -830,6 +824,13 @@ can be useful during testing.
:setting:`NAME` in :setting:`DATABASES` to match the name of the test
database.
+ .. deprecated:: 6.0
+
+ The ``serialize`` keyword argument is deprecated. Passing
+ ``serialize=True`` would automatically call
+ :func:`serialize_db_to_string` but it was deprecated as it could result
+ in queries against non-test databases during serialization.
+
.. function:: destroy_test_db(old_database_name, verbosity=1, keepdb=False)
Destroys the database whose name is the value of :setting:`NAME` in