I cannot access the context
attribute of an HttpResponse
object from ipython. But the unit test accesses context
.
Here is the unit
You can see in the Django test code where it monkeypatches in special instrumentation to make template rendering send a signal, which the test client listens to so it can annotate the response object with the rendered templates and their contexts.
For this signal to be attached, you'd have to either call the django.test.utils.setup_test_environment() function in your shell session (which has other side effects), or duplicate just the lines that monkeypatch template rendering. Not too hard, but I agree it'd be nice if this particular debugging aspect could be refactored out to make it easier to use outside of tests. Personally I wouldn't mind if this information was always collected when DEBUG is True, not just under test.