def test__str__(self):
"""
Test whether the __str__ method successfully generates a json string
representation of the object.
"""
# Confirm that the string representation of the current object and that
# of an object decoded from this string representation are equal.
str_o = str(self.o)
new_o = jsonpickle.decode(str_o)
self.assertEqual(str_o, str(new_o))
# Confirm that the property values are preserved through string
# encoding and decoding.
self.assertEqual(new_o.name, 'NameA')
self.assertEqual(new_o.description, 'DescriptionA')
评论列表
文章目录