示例#1
0
 def test_default_json_encoder_datetime(self):
     now = datetime.utcnow()
     self.assertEqual(default_json_encoder(now), now.isoformat())
示例#2
0
 def test_default_json_encoder_unhandled(self):
     self.assertIsNone(default_json_encoder(1), None)
示例#3
0
 def test_default_json_encoder_decimal(self):
     self.assertAlmostEqual(
         default_json_encoder(Decimal("1.2")), 1.2, places=2)