mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Refs #24121 -- Added meaningful repr() to HttpResponse and subclasses.
This commit is contained in:
parent
b356dc4e07
commit
c96f11257b
3 changed files with 38 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue