mirror of
https://github.com/django/django.git
synced 2025-08-31 15:57:45 +00:00
Fixed #24652 -- Disallowed query execution in SimpleTestCase subclasses.
Thanks to Tim and Anssi for the review.
This commit is contained in:
parent
ead36e8a47
commit
c15b0c2792
4 changed files with 64 additions and 0 deletions
|
@ -606,6 +606,17 @@ features like:
|
|||
then you should use :class:`~django.test.TransactionTestCase` or
|
||||
:class:`~django.test.TestCase` instead.
|
||||
|
||||
.. attribute:: SimpleTestCase.allow_database_queries
|
||||
|
||||
.. versionadded:: 1.9
|
||||
|
||||
:class:`~SimpleTestCase` disallows database queries by default. This
|
||||
helps to avoid executing write queries which will affect other tests
|
||||
since each ``SimpleTestCase`` test isn't run in a transaction. If you
|
||||
aren't concerned about this problem, you can disable this behavior by
|
||||
setting the ``allow_database_queries`` class attribute to ``True`` on
|
||||
your test class.
|
||||
|
||||
``SimpleTestCase`` inherits from ``unittest.TestCase``.
|
||||
|
||||
.. warning::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue