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

Fixed #15122 -- Restored reporting of the template files tried in the texmplate loader post mortem section of the TemplateDoesNotExit 500 error debug page. Thanks rdrey for reporting this regression.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales
2011-01-20 22:33:58 +00:00
parent 8308ad4f05
commit 19bfdadc43
4 changed files with 20 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ from django import forms
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import get_resolver
from django.shortcuts import render_to_response, render
from django.template import Context, RequestContext
from django.template import Context, RequestContext, TemplateDoesNotExist
from django.views.debug import technical_500_response
from django.views.generic.create_update import create_object
@@ -120,3 +120,11 @@ def render_view_with_current_app_conflict(request):
'foo': 'FOO',
'bar': 'BAR',
}, current_app="foobar_app", context_instance=RequestContext(request))
def raises_template_does_not_exist(request):
# We need to inspect the HTML generated by the fancy 500 debug view but
# the test client ignores it, so we send it explicitly.
try:
return render_to_response('i_dont_exist.html')
except TemplateDoesNotExist:
return technical_500_response(request, *sys.exc_info())