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
1 changed files with 10 additions and 0 deletions

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):