﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31281	Make TestClient run transaction.on_commit actions.	François Freitag	nobody	"Currently, when [https://docs.djangoproject.com/en/dev/ref/settings/#atomic-requests ATOMIC_REQUESTS] is `True`, actions scheduled with the [https://docs.djangoproject.com/en/dev/topics/db/transactions/#performing-actions-after-commit on_commit] hook are not run by the test `Client`.

Commit hooks can be run manually, e.g. by subclassing Django’s test `Client` and running the hooks after the parent’s `request()`generated the response. However, it makes a difference with real-world requests, for which hooks run before the middleware chain processes the response.

The `ClientHandler` defined in `django/test/client.py` is private and the `Client` does not offer to override its handler (except by subclassing the view and forcefully setting the handler attribute to a customized handler instance.

Maybe the default test `ClientHandler` should override `make_view_atomic()` to run `on_commit` hooks right after the view function is executed?"	New feature	closed	Testing framework	dev	Normal	duplicate		Simon Charette	Unreviewed	0	0	0	0	0	0
