1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #28478 -- Removed support for TestCase's allow_database_queries and multi_db per deprecation timeline.

This commit is contained in:
Mariusz Felisiak
2019-09-07 11:57:46 +02:00
parent f1894bae30
commit b61ea56789
6 changed files with 9 additions and 146 deletions

View File

@@ -1091,9 +1091,8 @@ Miscellaneous
* In order to enforce test isolation, database queries are not allowed
by default in :class:`~django.test.SimpleTestCase` tests anymore. You
can disable this behavior by setting the
:attr:`~django.test.SimpleTestCase.allow_database_queries` class attribute
to ``True`` on your test class.
can disable this behavior by setting the ``allow_database_queries`` class
attribute to ``True`` on your test class.
* ``ResolverMatch.app_name`` was changed to contain the full namespace path in
the case of nested namespaces. For consistency with

View File

@@ -508,8 +508,8 @@ Miscellaneous
first positional argument, if it accepts it. Support for overrides that don't
accept it will be removed in Django 3.1.
* The :attr:`.SimpleTestCase.allow_database_queries`,
:attr:`.TransactionTestCase.multi_db`, and :attr:`.TestCase.multi_db`
* The ``SimpleTestCase.allow_database_queries``,
``TransactionTestCase.multi_db``, and ``TestCase.multi_db``
attributes are deprecated in favor of :attr:`.SimpleTestCase.databases`,
:attr:`.TransactionTestCase.databases`, and :attr:`.TestCase.databases`.
These new attributes allow databases dependencies to be declared in order to

View File

@@ -240,3 +240,6 @@ to remove usage of these features.
* The ``FILE_CHARSET`` setting is removed.
* ``django.contrib.staticfiles.storage.CachedStaticFilesStorage`` is removed.
* Support for ``SimpleTestCase.allow_database_queries`` and
``TransactionTestCase.multi_db`` is removed.

View File

@@ -747,14 +747,6 @@ If your tests make any database queries, use subclasses
setting the ``databases`` class attribute to ``'__all__'`` on your test
class.
.. attribute:: SimpleTestCase.allow_database_queries
.. deprecated:: 2.2
This attribute is deprecated in favor of :attr:`databases`. The previous
behavior of ``allow_database_queries = True`` can be achieved by setting
``databases = '__all__'``.
.. warning::
``SimpleTestCase`` and its subclasses (e.g. ``TestCase``, ...) rely on
@@ -1180,14 +1172,6 @@ only loaded into the ``default`` database.
Queries against databases not in ``databases`` will give assertion errors to
prevent state leaking between tests.
.. attribute:: TransactionTestCase.multi_db
.. deprecated:: 2.2
This attribute is deprecated in favor of :attr:`~TransactionTestCase.databases`.
The previous behavior of ``multi_db = True`` can be achieved by setting
``databases = '__all__'``.
.. attribute:: TestCase.databases
By default, only the ``default`` database will be wrapped in a transaction
@@ -1210,14 +1194,6 @@ This test will only allow queries against the ``other`` database. Just like for
``'__all__'`` constant can be used to specify that the test should allow
queries to all databases.
.. attribute:: TestCase.multi_db
.. deprecated:: 2.2
This attribute is deprecated in favor of :attr:`~TestCase.databases`. The
previous behavior of ``multi_db = True`` can be achieved by setting
``databases = '__all__'``.
.. _overriding-settings:
Overriding settings