diff options
| author | Moayad Mardini <moayad.m@gmail.com> | 2014-07-27 11:12:39 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-28 10:57:49 -0400 |
| commit | acbe3fac7c1210aacf2a931d9c5dde4f8fecd6c4 (patch) | |
| tree | 09fc10c801352554846d9ca99f130db2dea4e6ed /docs/topics/testing | |
| parent | 2077bbe3fefb58eadfde0f2f36af13a0f1d3704a (diff) | |
[1.7.x] Fixed #22491 -- documented how select_for_update() should be tested.
Thanks Andreas Pelme for the report.
Backport of 668d432d0a from master
Diffstat (limited to 'docs/topics/testing')
| -rw-r--r-- | docs/topics/testing/tools.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index c34058af7c..b7e0fff127 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -622,7 +622,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). ``TransactionTestCase`` inherits from :class:`~django.test.SimpleTestCase`. |
