summaryrefslogtreecommitdiff
path: root/tests/test_client
diff options
context:
space:
mode:
authorTom Carrick <tom@carrick.eu>2020-07-14 13:32:24 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-09-14 08:41:59 +0200
commitbcc2befd0e9c1885e45b46d0b0bcdc11def8b249 (patch)
tree59fab69a3182286da87fcd6fe05a8ce0f4277a5a /tests/test_client
parent71ae1ab0123582cc5bfe0f7d5f4cc19a9412f396 (diff)
downloaddjango-bcc2befd0e9c1885e45b46d0b0bcdc11def8b249.tar.gz
Fixed #31789 -- Added a new headers interface to HttpResponse.
Diffstat (limited to 'tests/test_client')
-rw-r--r--tests/test_client/tests.py2
-rw-r--r--tests/test_client/views.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py
index 03bb658952..f0b7f798a0 100644
--- a/tests/test_client/tests.py
+++ b/tests/test_client/tests.py
@@ -159,7 +159,7 @@ class ClientTest(TestCase):
"Check the value of HTTP headers returned in a response"
response = self.client.get("/header_view/")
- self.assertEqual(response['X-DJANGO-TEST'], 'Slartibartfast')
+ self.assertEqual(response.headers['X-DJANGO-TEST'], 'Slartibartfast')
def test_response_attached_request(self):
"""
diff --git a/tests/test_client/views.py b/tests/test_client/views.py
index 034ca6908c..38fbeae797 100644
--- a/tests/test_client/views.py
+++ b/tests/test_client/views.py
@@ -102,7 +102,7 @@ def json_view(request):
def view_with_header(request):
"A view that has a custom header"
response = HttpResponse()
- response['X-DJANGO-TEST'] = 'Slartibartfast'
+ response.headers['X-DJANGO-TEST'] = 'Slartibartfast'
return response