def test_str(self):
snowman = "\u2603"
obj = {'a': [1, 2, snowman]}
j = psycopg2.extensions.adapt(psycopg2.extras.Json(obj))
s = str(j)
self.assertTrue(isinstance(s, str))
# no pesky b's
self.assertTrue(s.startswith("'"))
self.assertTrue(s.endswith("'"))
评论列表
文章目录