From 668d432d0a25ef68e101f2c6492dc4d75da931bd Mon Sep 17 00:00:00 2001 From: Moayad Mardini Date: Sun, 27 Jul 2014 11:12:39 +0300 Subject: Fixed #22491 -- documented how select_for_update() should be tested. Thanks Andreas Pelme for the report. --- 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 ecff777263..9f671044a8 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -636,7 +636,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`. -- cgit v1.3