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:12 -0400 |
| commit | 668d432d0a25ef68e101f2c6492dc4d75da931bd (patch) | |
| tree | a04ac89974e3e84d892592f7d93fac4919ecb15a /docs/topics | |
| parent | 0af593dbe5cae53543456fefb9ec9e2c8cc0146a (diff) | |
Fixed #22491 -- documented how select_for_update() should be tested.
Thanks Andreas Pelme for the report.
Diffstat (limited to 'docs/topics')
| -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 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`. |
