From 9aa56cb0d5dede7fc176a46c745dfd3dacdad773 Mon Sep 17 00:00:00 2001 From: sage Date: Wed, 27 Mar 2019 11:40:10 +0700 Subject: Fixed #30294 -- Allowed HttpResponse to accept memoryview content. --- tests/httpwrappers/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index e6c6297898..0c81cd0341 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -366,6 +366,10 @@ class HttpResponseTests(unittest.TestCase): r.content = 12345 self.assertEqual(r.content, b'12345') + def test_memoryview_content(self): + r = HttpResponse(memoryview(b'memoryview')) + self.assertEqual(r.content, b'memoryview') + def test_iter_content(self): r = HttpResponse(['abc', 'def', 'ghi']) self.assertEqual(r.content, b'abcdefghi') -- cgit v1.3