But there are two problems with this: 1) it's impossible to turn off (and
sometimes there are times when you'd want to, e.g. if testing behavior of
`handle_uncaught_exception` in a custom WSGI handler subclass), and 2)
Django has long had an alternate method to do exactly the same thing, the
`DEBUG_PROPAGATE_EXCEPTIONS` setting.
The setting is much simpler, and it's easy to turn off for a selected
test.
I think we should at least provide a way to turn off the test client re-
raising behavior (perhaps via a flag set on the client).
I'm tempted to suggest we should also at some point raise a deprecation
warning if this flag is not set, suggesting to use
DEBUG_PROPAGATE_EXCEPTIONS when running tests instead, and then later
remove the test-client re-raising altogether. But removing this bit of
code may not be worth the churn of that deprecation.
--
Ticket URL: <https://code.djangoproject.com/ticket/27893>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
Would you consider this a duplicate of #18707? The solution you proposed
about adding an option to `Client` is proposed in comment 1.
--
Ticket URL: <https://code.djangoproject.com/ticket/27893#comment:1>
* status: new => closed
* resolution: => duplicate
--
Ticket URL: <https://code.djangoproject.com/ticket/27893#comment:2>
Comment (by Carl Meyer):
Yeah, it's a duplicate - thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/27893#comment:3>