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:
committed by
Tim Graham
parent
a7fe87bd28
commit
6c70b1d7df
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user