#30457: on_commit should be triggered in a TestCase
-------------------------------------+-------------------------------------
Reporter: Bernhard Mäder | Owner: Adam
| (Chainz) Johnson
Type: New feature | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: on_commit TestCase | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam (Chainz) Johnson):
* owner: Jannah Mandwee => Adam (Chainz) Johnson
Comment:
I've created an alternate PR that adds `TestCase.captureOnCommitCallbacks`
: [PR #12944](https://github.com/django/django/pull/12944). This returns a
context manager that captures the hooks and optionally calls them as the
context manager yields. It also returns them as a list so assertions can
be made on the hooks, and they can be selectively executed.
I also put the code in a package tested on Django 2.0+:
https://github.com/adamchainz/django-capture-on-commit-callbacks
--
Ticket URL: <https://code.djangoproject.com/ticket/30457#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.d908724c132a164afeb07c6a938657b6%40djangoproject.com.