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

Fixed #25163 -- Fixed exception handling in nested test client requests.

This commit is contained in:
pscottdevos
2015-08-07 14:28:54 -05:00
committed by Tim Graham
parent 56ed80ac2a
commit 7fa1dd8a80
4 changed files with 23 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ from django.http import (
)
from django.shortcuts import render_to_response
from django.template import Context, Template
from django.test import Client
from django.utils.decorators import method_decorator
from django.utils.six.moves.urllib.parse import urlencode
@@ -309,5 +310,15 @@ def mass_mail_sending_view(request):
return HttpResponse("Mail sent")
def nesting_exception_view(request):
"""
A view that uses a nested client to call another view and then raises an
exception.
"""
client = Client()
client.get('/get_view/')
raise Exception('exception message')
def django_project_redirect(request):
return HttpResponseRedirect('https://www.djangoproject.com/')