mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #27640 -- Fixed HttpResponse's __repr__() without a 'Content-Type' header.
This commit is contained in:
@@ -136,6 +136,11 @@ class HttpResponseTests(SimpleTestCase):
|
||||
expected = '<HttpResponse status_code=201, "text/html; charset=utf-8">'
|
||||
self.assertEqual(repr(response), expected)
|
||||
|
||||
def test_repr_no_content_type(self):
|
||||
response = HttpResponse(status=204)
|
||||
del response['Content-Type']
|
||||
self.assertEqual(repr(response), '<HttpResponse status_code=204>')
|
||||
|
||||
def test_wrap_textiowrapper(self):
|
||||
content = "Café :)"
|
||||
r = HttpResponse()
|
||||
|
||||
Reference in New Issue
Block a user