def test_unicode_body(): res = Response() res.charset = 'utf-8' bbody = b'La Pe\xc3\xb1a' # binary string ubody = text_(bbody, 'utf-8') # unicode string res.body = bbody assert res.unicode_body == ubody res.ubody = ubody assert res.body == bbody del res.ubody assert res.body == b''
def test_unicode_body(): res = Response() res.charset = "utf-8" bbody = b"La Pe\xc3\xb1a" # binary string ubody = text_(bbody, "utf-8") # unicode string res.body = bbody assert res.unicode_body == ubody res.ubody = ubody assert res.body == bbody del res.ubody assert res.body == b""
def test_unicode_body(): res = Response() res.charset = 'utf-8' bbody = b'La Pe\xc3\xb1a' # binary string ubody = text_(bbody, 'utf-8') # unicode string res.body = bbody eq_(res.unicode_body, ubody) res.ubody = ubody eq_(res.body, bbody) del res.ubody eq_(res.body, b'')
def test_unicode_body(): res = Response() res.charset = "utf-8" bbody = b"La Pe\xc3\xb1a" # binary string ubody = text_(bbody, "utf-8") # unicode string res.body = bbody eq_(res.unicode_body, ubody) res.ubody = ubody eq_(res.body, bbody) del res.ubody eq_(res.body, b"")