﻿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
30249	Deprecate re-raising view exceptions from test client in tests	Jon Dufresne	nobody	"This is a continuation of the work started in ticket #18707.

Set for removal in 4.0.

By no longer re-raising the view exceptions in tests, we'll move the test `Client` closer to behaving like a real world HTTP client. This assists integration tests by providing more realistic side effects to test against. Instead of altering the behavior under test, integration tests can more reliably test the full stack, including the error handlers (which were previously skipped in the default configuration).

Additionally, this behavior is duplicating the setting [https://docs.djangoproject.com/en/2.2/ref/settings/#debug-propagate-exceptions DEBUG_PROPAGATE_EXCEPTIONS].

Should a test want this behavior explicitly, it is already available by adjusting this setting. For example:

{{{
class MyTest(TestCase):
    @override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True)
    def test_raises_exception(self):
        with self.assertRaises(KeyError):
            self.client.get('/broken_view/')
}}}

To assist in the deprecation period, I've opted to allow users to force the new behavior and silence warnings by setting `DEBUG_PROPAGATE_EXCEPTIONS` to the alternative falsey value `None`.
"	Cleanup/optimization	closed	Testing framework	dev	Normal	needsinfo			Unreviewed	1	0	0	1	0	0
