Merge "fix empty body getter bug 1067923"
This commit is contained in:
2 changed files with 7 additions and 0 deletions
@@ -300,6 +300,8 @@ def _resp_body_property():
"""
def getter(self):
if not self._body:
if not self._app_iter:
return ''
self._body = ''.join(self._app_iter)
self._app_iter = None
return self._body
@@ -352,6 +352,11 @@ class TestResponse(unittest.TestCase):
resp.content_type = None
self.assert_('Content-Type' not in resp.headers)
def test_empty_body(self):
resp = self._get_response()
resp.body = ''
self.assertEquals(resp.body, '')
def test_unicode_body(self):
resp = self._get_response()
resp.body = u'\N{SNOWMAN}'
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.