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

Refs #24121 -- Added meaningful repr() to HttpResponse and subclasses.

This commit is contained in:
Keryn Knight
2015-07-13 15:32:09 +01:00
committed by Tim Graham
parent b356dc4e07
commit c96f11257b
3 changed files with 38 additions and 0 deletions

View File

@@ -107,3 +107,8 @@ class HttpResponseTests(SimpleTestCase):
response = HttpResponse(iso_content, content_type='text/plain')
self.assertContains(response, iso_content)
def test_repr(self):
response = HttpResponse(content="Café :)".encode(UTF8), status=201)
expected = '<HttpResponse status_code=201, "text/html; charset=utf-8">'
self.assertEqual(repr(response), expected)