#30249: Deprecate re-raising view exceptions from test client in tests
               Reporter:  Jon Dufresne          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Testing framework     |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
 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

 Should a test want this behavior explicitly, it is already available by
 adjusting this setting. For example:

 class MyTest(TestCase):
     def test_raises_exception(self):
         with self.assertRaises(KeyError):

 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`.

Ticket URL: <https://code.djangoproject.com/ticket/30249>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to