Exemple #1
0
 def test_datetime_formats(self):
     f = [(datetime.datetime(2013, 1, 2, 3, 4, 0),
           "2013-01-02 03:04:00", "03:04", "02.01.2013"),
          (datetime.datetime(2013, 5, 2),
           "2013-05-02 00:00:00", "00:00", "02.05.2013"),
          (datetime.datetime(2013, 2, 2, 3, 4, 30),
           "2013-02-02 03:04:30", "03:04", "02.02.2013")]
     for dt, sf, st, sd in f:
         self.assertEqual(fullformat(dt), sf)
         self.assertEqual(dateformat(dt), sd)
         self.assertEqual(timeformat(dt), st)
Exemple #2
0
 def __str__(self):
     return "Start: %s, End: %s, when: %s, now: %s, line: %s" % (
         self.start, self.end, timeformat(self.when),
         timeformat(self.now), self.line)