Try to decode bytestrings from UTF8 in json_safe

Closes #148
This commit is contained in:
Kevin McCarthy
2014-07-06 10:27:17 -10:00
parent 320e994c30
commit 540b414490
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -47,6 +47,10 @@ class HttpbinTestCase(unittest.TestCase):
response = self.app.post('/post', data={"file": f.read()})
self.assertEqual(response.status_code, 200)
def test_post_body_unicode(self):
response = self.app.post('/post', data=u'оживлённым'.encode('utf-8'))
self.assertEqual(json.loads(response.data.decode('utf-8'))['data'], u'оживлённым')
def test_post_file_with_missing_content_type_header(self):
# I built up the form data manually here because I couldn't find a way
# to convince the werkzeug test client to send files without the