summaryrefslogtreecommitdiff
path: root/tests/httpwrappers
diff options
context:
space:
mode:
authorTom Carrick <tom@carrick.eu>2020-10-07 08:10:35 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-07 09:19:57 +0200
commit2e7cc95499f758a1c4aa036cbf1dcddf82a89ea2 (patch)
tree1ed74455bddfb142436eeb3955ecf4f0816d4505 /tests/httpwrappers
parent07a30f561661efae1691ff45d10ec6014b395b58 (diff)
downloaddjango-2e7cc95499f758a1c4aa036cbf1dcddf82a89ea2.tar.gz
Refs #32002 -- Added tests for HttpResponse's content_type parameter.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r--tests/httpwrappers/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index 3c648f6b31..fbc5019979 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -470,6 +470,10 @@ class HttpResponseTests(unittest.TestCase):
# del doesn't raise a KeyError on nonexistent headers.
del r.headers['X-Foo']
+ def test_content_type(self):
+ r = HttpResponse('hello', content_type='application/json')
+ self.assertEqual(r.headers['Content-Type'], 'application/json')
+
class HttpResponseSubclassesTests(SimpleTestCase):
def test_redirect(self):