Refs #25969 -- Replaced usage of render_to_response() with render() in tests.

This commit is contained in:
Tim Graham 2015-12-22 13:50:16 -05:00
parent 312fc1af7b
commit edf3b88f1a
4 changed files with 19 additions and 20 deletions

View file

@ -8,7 +8,7 @@ import sys
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.urlresolvers import get_resolver
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import render, render_to_response
from django.shortcuts import render
from django.template import TemplateDoesNotExist
from django.views.debug import (
SafeExceptionReporterFilter, technical_500_response,
@ -74,23 +74,22 @@ def view_exception(request, n):
def template_exception(request, n):
return render_to_response('debug/template_exception.html',
{'arg': except_args[int(n)]})
return render(request, 'debug/template_exception.html', {'arg': except_args[int(n)]})
def jsi18n(request):
return render_to_response('jsi18n.html')
return render(request, 'jsi18n.html')
def jsi18n_multi_catalogs(request):
return render_to_response('jsi18n-multi-catalogs.html')
return render(render, 'jsi18n-multi-catalogs.html')
def raises_template_does_not_exist(request, path='i_dont_exist.html'):
# 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(path)
return render(request, path)
except TemplateDoesNotExist:
return technical_500_response(request, *sys.exc_info())