summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_wsgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_wsgi.py')
-rw-r--r--tests/unit/test_wsgi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/test_wsgi.py b/tests/unit/test_wsgi.py
index 07c85d5..c621a8c 100644
--- a/tests/unit/test_wsgi.py
+++ b/tests/unit/test_wsgi.py
@@ -179,6 +179,17 @@ class JSONDictSerializerTest(unittest.TestCase):
result = result.replace('\n', '').replace(' ', '')
self.assertEqual(result, expected_json)
+ def test_object_unicode(self):
+ class TestUnicode:
+ def __unicode__(self):
+ return u'TestUnicode'
+ input_dict = dict(cls=TestUnicode())
+ expected_str = '{"cls":"TestUnicode"}'
+ serializer = wsgi.JSONDictSerializer()
+ result = serializer.serialize(input_dict)
+ result = result.replace('\n', '').replace(' ', '')
+ self.assertEqual(result, expected_str)
+
class TextDeserializerTest(unittest.TestCase):