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

Fixed #5836 -- Corrected the logic in the Test Client when an exception raised by a view is caught and re-raised. Thanks for the report, test case, and fix, Chris Wagner.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2008-06-07 06:25:59 +00:00
parent 5b9d907ae8
commit 8a7bbc3c34
7 changed files with 95 additions and 3 deletions

View File

@@ -179,10 +179,15 @@ class Client:
if e.args != ('500.html',):
raise
# Look for a signalled exception and reraise it
# Look for a signalled exception, clear the current context
# exception data, then re-raise the signalled exception.
# Also make sure that the signalled exception is cleared from
# the local cache!
if self.exc_info:
raise self.exc_info[1], None, self.exc_info[2]
exc_info = self.exc_info
self.exc_info = None
raise exc_info[1], None, exc_info[2]
# Save the client and request that stimulated the response
response.client = self
response.request = request