def test_json_method(self): obj = lambda: 1 obj.__json__ = lambda: "anotherjson" self.assertEqual("anotherjson", encode(obj))
def test_asis(self): obj = [1, 2] self.assertEqual("[1, 2]", encode(obj))
def test_json(self): obj = lambda: 1 obj.json = "myjson" self.assertEqual("myjson", encode(obj))