Exemple #1
0
 def test_serialize_date(self):
     now = dates.now().date()
     nowstr = now.isoformat()
     self.assertEqual(nowstr, dates.serialize_date(now))
Exemple #2
0
 def test_serialize_datetime_as_date(self):
     now = dates.now()
     self.assertTrue(isinstance(now, datetime.datetime))
     nowstr = dates.serialize_date(now)
     self.assertEquals(nowstr, now.date().isoformat())
Exemple #3
0
 def to_dict(self):
     if self.precision == 'day':
         return dates.serialize_date(self.value)
     return super(DateWithPrecision, self).to_dict()
Exemple #4
0
 def to_dict(self):
     if self.precision == 'day':
         return dates.serialize_date(self.value)
     return super(DateWithPrecision, self).to_dict()
Exemple #5
0
 def test_serialize_date(self):
     now = dates.now().date()
     nowstr = now.isoformat()
     self.assertEqual(nowstr, dates.serialize_date(now))