mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #28837 -- Fixed test client crash if an exception with more than one arg is raised.
Also removed usage of the problematic pattern elsewhere.
Regression in 6e55e1d88a.
This commit is contained in:
committed by
Tim Graham
parent
7a6fbf36b1
commit
746caf3ef8
@@ -29,7 +29,7 @@ from django.test import (
|
||||
)
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
from .views import get_view, post_view, trace_view
|
||||
from .views import TwoArgException, get_view, post_view, trace_view
|
||||
|
||||
|
||||
@override_settings(ROOT_URLCONF='test_client.urls')
|
||||
@@ -713,6 +713,11 @@ class ClientTest(TestCase):
|
||||
with self.assertRaisesMessage(Exception, 'exception message'):
|
||||
self.client.get('/nesting_exception_view/')
|
||||
|
||||
def test_response_raises_multi_arg_exception(self):
|
||||
"""A request may raise an exception with more than one required arg."""
|
||||
with self.assertRaises(TwoArgException):
|
||||
self.client.get('/two_arg_exception/')
|
||||
|
||||
def test_uploading_temp_file(self):
|
||||
with tempfile.TemporaryFile() as test_file:
|
||||
response = self.client.post('/upload_view/', data={'temp_file': test_file})
|
||||
|
||||
Reference in New Issue
Block a user