summaryrefslogtreecommitdiff
path: root/tests/responses/tests.py
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/responses/tests.py
parent71ae1ab0123582cc5bfe0f7d5f4cc19a9412f396 (diff)
Fixed #31789 -- Added a new headers interface to HttpResponse.
Diffstat (limited to 'tests/responses/tests.py')
-rw-r--r--tests/responses/tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/responses/tests.py b/tests/responses/tests.py
index 2c161ee352..059cdf86ed 100644
--- a/tests/responses/tests.py
+++ b/tests/responses/tests.py
@@ -39,12 +39,12 @@ class HttpResponseBaseTests(SimpleTestCase):
"""
r = HttpResponseBase()
- r['Header'] = 'Value'
+ r.headers['Header'] = 'Value'
r.setdefault('header', 'changed')
- self.assertEqual(r['header'], 'Value')
+ self.assertEqual(r.headers['header'], 'Value')
r.setdefault('x-header', 'DefaultValue')
- self.assertEqual(r['X-Header'], 'DefaultValue')
+ self.assertEqual(r.headers['X-Header'], 'DefaultValue')
class HttpResponseTests(SimpleTestCase):
@@ -92,7 +92,7 @@ class HttpResponseTests(SimpleTestCase):
response = HttpResponse(charset=ISO88591)
self.assertEqual(response.charset, ISO88591)
- self.assertEqual(response['Content-Type'], 'text/html; charset=%s' % ISO88591)
+ self.assertEqual(response.headers['Content-Type'], 'text/html; charset=%s' % ISO88591)
response = HttpResponse(content_type='text/plain; charset=%s' % UTF8, charset=ISO88591)
self.assertEqual(response.charset, ISO88591)
@@ -134,7 +134,7 @@ class HttpResponseTests(SimpleTestCase):
def test_repr_no_content_type(self):
response = HttpResponse(status=204)
- del response['Content-Type']
+ del response.headers['Content-Type']
self.assertEqual(repr(response), '<HttpResponse status_code=204>')
def test_wrap_textiowrapper(self):