1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #25163 -- Fixed exception handling in nested test client requests.

This commit is contained in:
pscottdevos
2015-08-07 14:28:54 -05:00
committed by Tim Graham
parent 56ed80ac2a
commit 7fa1dd8a80
4 changed files with 23 additions and 3 deletions

View File

@@ -640,6 +640,14 @@ class ClientTest(TestCase):
self.assertEqual(mail.outbox[1].to[0], 'second@example.com')
self.assertEqual(mail.outbox[1].to[1], 'third@example.com')
def test_exception_following_nested_client_request(self):
"""
A nested test client request shouldn't clobber exception signals from
the outer client request.
"""
with self.assertRaisesMessage(Exception, 'exception message'):
self.client.get('/nesting_exception_view/')
@override_settings(
MIDDLEWARE_CLASSES=['django.middleware.csrf.CsrfViewMiddleware'],