1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00

Added tests for HttpResponseBase.charset/reason_phrase setters.

This commit is contained in:
XDEv11 2023-06-11 02:43:05 +08:00 committed by GitHub
parent caf80cb41f
commit 221c27bd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,16 @@ class HttpResponseBaseTests(SimpleTestCase):
r.setdefault("x-header", "DefaultValue")
self.assertEqual(r.headers["X-Header"], "DefaultValue")
def test_charset_setter(self):
r = HttpResponseBase()
r.charset = "utf-8"
self.assertEqual(r.charset, "utf-8")
def test_reason_phrase_setter(self):
r = HttpResponseBase()
r.reason_phrase = "test"
self.assertEqual(r.reason_phrase, "test")
class HttpResponseTests(SimpleTestCase):
def test_status_code(self):