summaryrefslogtreecommitdiff
path: root/tests/template_tests
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/template_tests
parent71ae1ab0123582cc5bfe0f7d5f4cc19a9412f396 (diff)
Fixed #31789 -- Added a new headers interface to HttpResponse.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/test_response.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py
index cf5e955223..0a51d68f01 100644
--- a/tests/template_tests/test_response.py
+++ b/tests/template_tests/test_response.py
@@ -122,13 +122,13 @@ class SimpleTemplateResponseTest(SimpleTestCase):
def test_kwargs(self):
response = self._response(content_type='application/json', status=504, charset='ascii')
- self.assertEqual(response['content-type'], 'application/json')
+ self.assertEqual(response.headers['content-type'], 'application/json')
self.assertEqual(response.status_code, 504)
self.assertEqual(response.charset, 'ascii')
def test_args(self):
response = SimpleTemplateResponse('', {}, 'application/json', 504)
- self.assertEqual(response['content-type'], 'application/json')
+ self.assertEqual(response.headers['content-type'], 'application/json')
self.assertEqual(response.status_code, 504)
@require_jinja2
@@ -175,7 +175,7 @@ class SimpleTemplateResponseTest(SimpleTestCase):
unpickled_response = pickle.loads(pickled_response)
self.assertEqual(unpickled_response.content, response.content)
- self.assertEqual(unpickled_response['content-type'], response['content-type'])
+ self.assertEqual(unpickled_response.headers['content-type'], response.headers['content-type'])
self.assertEqual(unpickled_response.status_code, response.status_code)
# ...and the unpickled response doesn't have the
@@ -249,13 +249,13 @@ class TemplateResponseTest(SimpleTestCase):
def test_kwargs(self):
response = self._response(content_type='application/json', status=504)
- self.assertEqual(response['content-type'], 'application/json')
+ self.assertEqual(response.headers['content-type'], 'application/json')
self.assertEqual(response.status_code, 504)
def test_args(self):
response = TemplateResponse(self.factory.get('/'), '', {},
'application/json', 504)
- self.assertEqual(response['content-type'], 'application/json')
+ self.assertEqual(response.headers['content-type'], 'application/json')
self.assertEqual(response.status_code, 504)
@require_jinja2
@@ -287,7 +287,7 @@ class TemplateResponseTest(SimpleTestCase):
unpickled_response = pickle.loads(pickled_response)
self.assertEqual(unpickled_response.content, response.content)
- self.assertEqual(unpickled_response['content-type'], response['content-type'])
+ self.assertEqual(unpickled_response.headers['content-type'], response.headers['content-type'])
self.assertEqual(unpickled_response.status_code, response.status_code)
# ...and the unpickled response doesn't have the