mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
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.
This commit is contained in:
committed by
Mariusz Felisiak
parent
99ac8e2589
commit
2d34ebe49a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user