From 6c70b1d7df4bc6f666ee9fa55a305e7347862095 Mon Sep 17 00:00:00 2001 From: Moayad Mardini Date: Sun, 27 Jul 2014 11:12:39 +0300 Subject: [1.6.x] Fixed #22491 -- documented how select_for_update() should be tested. Thanks Andreas Pelme for the report. Backport of 668d432d0a from master --- docs/topics/testing/tools.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs/topics/testing') diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 3961ce852a..db11475a6f 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -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 -- cgit v1.3