With the current django.test.client.Client class it is not possible to inspect an exception created by the code being tested.
For example, a view may raise an exception due to syntax error, malformed input from the test case or for any number of reasons. The exception is handled by Django and a standard error view (either a 500 page or error debug page) is returned with no other indication about the original exception. It is therefore difficult to track down the actual cause of the error.
A simple patch can handle the got_request_exception signal created by the base handler and capture the actual exception object and it's associated exc_info. The exception can then be reraised, complete with the original frame/location information, after the handler has finished. The exception can then be inspected by the test case. The standard behaviour of the test case is to print a stack trace to stdout, which is very useful when creating or fixing tests. As the exception location information is not modified, the original cause can be found and fixed.