Fixed #33054 -- Made TestCase.captureOnCommitCallbacks() capture callbacks recursively.

This commit is contained in:
Eugene Morozov 2021-08-24 23:29:55 +03:00 committed by Mariusz Felisiak
parent 02bc7161ec
commit d89f976bdd
4 changed files with 27 additions and 5 deletions

View file

@ -368,6 +368,9 @@ Tests
* The :option:`test --parallel` option now supports the value ``auto`` to run
one test process for each processor core.
* :meth:`.TestCase.captureOnCommitCallbacks` now captures new callbacks added
while executing :func:`.transaction.on_commit` callbacks.
URLs
~~~~

View file

@ -912,6 +912,11 @@ It also provides an additional method:
self.assertEqual(mail.outbox[0].subject, 'Contact Form')
self.assertEqual(mail.outbox[0].body, 'I like your site')
.. versionchanged:: 4.0
In older versions, new callbacks added while executing
:func:`.transaction.on_commit` callbacks were not captured.
.. _live-test-server:
``LiveServerTestCase``