diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py
index 03bb658952..cfdaf794af 100644
a
|
b
|
class ClientTest(TestCase):
|
872 | 872 | response = self.client.post('/upload_view/', data={'named_temp_file': test_file}) |
873 | 873 | self.assertEqual(response.content, b'named_temp_file') |
874 | 874 | |
| 875 | def test_request_headers(self): |
| 876 | response = self.client.get('/request_headers/', **{'someheader': 'some header value'}) |
| 877 | response_text = response.content.decode('utf8') |
| 878 | self.assertEqual(response_text, 'someheader: some header value; someheader_meta: some header value') |
| 879 | |
875 | 880 | |
876 | 881 | @override_settings( |
877 | 882 | MIDDLEWARE=['django.middleware.csrf.CsrfViewMiddleware'], |
diff --git a/tests/test_client/urls.py b/tests/test_client/urls.py
index 1bc552ba5d..0d4688eef3 100644
a
|
b
|
urlpatterns = [
|
47 | 47 | path('nesting_exception_view/', views.nesting_exception_view), |
48 | 48 | path('django_project_redirect/', views.django_project_redirect), |
49 | 49 | path('two_arg_exception/', views.two_arg_exception), |
| 50 | path('request_headers/', views.request_headers), |
50 | 51 | |
51 | 52 | path('accounts/', RedirectView.as_view(url='login/')), |
52 | 53 | path('accounts/no_trailing_slash', RedirectView.as_view(url='login/')), |
diff --git a/tests/test_client/views.py b/tests/test_client/views.py
index 034ca6908c..8aa41f8539 100644
a
|
b
|
class TwoArgException(Exception):
|
394 | 394 | |
395 | 395 | def two_arg_exception(request): |
396 | 396 | raise TwoArgException('one', 'two') |
| 397 | |
| 398 | |
| 399 | def request_headers(request): |
| 400 | someheader = request.headers.get('someheader', None) |
| 401 | someheader_meta = request.META.get('someheader', None) |
| 402 | content = f'someheader: {someheader}; someheader_meta: {someheader_meta}' |
| 403 | return HttpResponse(content) |