﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8358	Test client raises UnboundLocalError when view raises exception and 500.html does not exist.	Ryan Freckleton	nobody	"If an exception is raised in a view that is requested by the test client and the 500.html template does not exist, the test fails with the following traceback:


{{{
Traceback (most recent call last):
  File ""/home/ryan/src/django_stuff/client_test/../client_test/test_app/tests.py"", line 5, in test
    response = self.client.get('/')
  File ""/home/ryan/src/django_stuff/django_py/lib/python2.5/site-packages/django/test/client.py"", line 265, in get
    return self.request(**r)
  File ""/home/ryan/src/django_stuff/django_py/lib/python2.5/site-packages/django/test/client.py"", line 231, in request
    response.client = self
UnboundLocalError: local variable 'response' referenced before assignment
}}}

The view function used to generate this was:

{{{
def raise_error(request):
    raise Exception()

}}}

self.exc_info in the client is not set, so no exception is raised at line client.py:225-228, and an UnboundLocalError is raised at line 231.

This could possibly be related to issue #8136, but I'm not really sure."		closed	Testing framework	dev		fixed	test client exception unboundlocalerror		Accepted	0	0	0	0	0	0
