1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #5897 -- Added the Content-Length response header in CommonMiddleware

Thanks Tim Graham for the review.
This commit is contained in:
Claude Paroz
2016-06-18 10:51:38 +02:00
parent ca77b50905
commit 9588718cd4
6 changed files with 44 additions and 5 deletions

View File

@@ -41,11 +41,12 @@ class WSGITest(SimpleTestCase):
self.assertEqual(response_data["status"], "200 OK")
self.assertEqual(
response_data["headers"],
[('Content-Type', 'text/html; charset=utf-8')])
self.assertEqual(
bytes(response),
b"Content-Type: text/html; charset=utf-8\r\n\r\nHello World!")
set(response_data["headers"]),
{('Content-Length', '12'), ('Content-Type', 'text/html; charset=utf-8')})
self.assertTrue(bytes(response) in [
b"Content-Length: 12\r\nContent-Type: text/html; charset=utf-8\r\n\r\nHello World!",
b"Content-Type: text/html; charset=utf-8\r\nContent-Length: 12\r\n\r\nHello World!"
])
def test_file_wrapper(self):
"""