def test_date(self): d = datetime.datetime(2019, 9, 18, 21, 30, 7, 303) enc = HRDjangoJSONEncoder() s = enc.encode(d) self.assertGreater(len(s), 10) d = datetime.date(2019, 9, 18) s = enc.encode(d) self.assertGreater(len(s), 5)
def test_class(self): d = self.TestSrClass(10, 'miles') enc = HRDjangoJSONEncoder() s = enc.encode(d) self.assertGreater(len(s), 4)
def test_long_text(self): d = {'text': 'Blah' * 100} enc = HRDjangoJSONEncoder() s = enc.encode(d) self.assertLess(len(s), 260)
def test_set(self): d = {'alpha', 'bravo', '', 'delta'} enc = HRDjangoJSONEncoder() s = enc.encode(d) self.assertGreater(len(s), 10)