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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user