-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on_commit support #752
Comments
For my particular usecase my task system submits tasks in on commit. So if we error out of a transaction we don't run any associated tasks. It would be nice if there was a django_db variant that just ran the on_commit code at the same place it would run if transaction=True. It would also be nice if it had roughly equivalent performance as transaction=False so I could just blanket use it everywhere. |
FWIW for testing a scenario where
|
Since I created this issue I've also come across https://pypi.org/project/django-capture-on-commit-callbacks/ @trawick if you just want to validate that the call happens that is a simple and effective soution. |
Django 3.2 added I would be happy for a PR if anyone would like to work on it! |
Similar to Django's `TestCase.captureOnCommitCallbacks`. Documentation is cribbed from there. Fixes pytest-dev#752.
Similar to Django's `TestCase.captureOnCommitCallbacks`. Documentation is cribbed from there. Fixes pytest-dev#752.
Similar to Django's `TestCase.captureOnCommitCallbacks`. Documentation is cribbed from there. Fixes pytest-dev#752.
Similar to Django's `TestCase.captureOnCommitCallbacks`. Documentation is cribbed from there. Fixes #752.
It would be nice if pytest-django had on_commit support that didn't require a django_db(transaction=True) mark, something like this maybe.
https://medium.com/gitux/speed-up-django-transaction-hooks-tests-6de4a558ef96
The text was updated successfully, but these errors were encountered: