From bcc2befd0e9c1885e45b46d0b0bcdc11def8b249 Mon Sep 17 00:00:00 2001 From: Tom Carrick Date: Tue, 14 Jul 2020 13:32:24 +0200 Subject: Fixed #31789 -- Added a new headers interface to HttpResponse. --- tests/template_tests/test_response.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/template_tests') 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 -- cgit v1.3