1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.6.x] Fixed #22491 -- documented how select_for_update() should be tested.

Thanks Andreas Pelme for the report.

Backport of 668d432d0a from master
This commit is contained in:
Moayad Mardini
2014-07-27 11:12:39 +03:00
committed by Tim Graham
parent a7fe87bd28
commit 6c70b1d7df
2 changed files with 21 additions and 7 deletions

View File

@@ -623,7 +623,10 @@ to test the effects of commit and rollback:
While ``commit`` and ``rollback`` operations still *appear* to work when
used in ``TestCase``, no actual commit or rollback will be performed by the
database. This can cause your tests to pass or fail unexpectedly. Always
use ``TransactionTestCase`` when testing transactional behavior.
use ``TransactionTestCase`` when testing transactional behavior or any code
that can't normally be excuted in autocommit mode
(:meth:`~django.db.models.query.QuerySet.select_for_update()` is an
example).
.. versionchanged:: 1.5