Ejemplo n.º 1
0
 def testToDisplayWithTime(self):
     event = self._makeOne('2000/10/12 06:00:00', '2000/10/12 18:00:00')
     self.assertEqual(toDisplay(event),
             {'start_date': 'Oct 12, 2000',
              'start_time' : '06:00 AM',
              'start_iso': '2000-10-12T06:00:00',
              'end_date' : 'Oct 12, 2000',
              'end_time' : '06:00 PM',
              'end_iso': '2000-10-12T18:00:00',
              'same_day' : True,
              'same_time' : False,
             })
Ejemplo n.º 2
0
 def testToDisplayWholeDayDifferentDays(self):
     event = self._makeOne('2000/10/12 06:00:00', '2000/10/13 18:00:00',
                       whole_day=True)
     self.assertEqual(toDisplay(event),
             {'start_date': 'Oct 12, 2000',
              'start_time' : None,
              'start_iso': '2000-10-12T06:00:00',
              'end_date' : 'Oct 13, 2000',
              'end_time' : None,
              'end_iso': '2000-10-13T18:00:00',
              'same_day' : False,
              'same_time' : False,
             })
Ejemplo n.º 3
0
 def testToDisplayWholeDaySameDay(self):
     # TODO: fake event doesn't set end time to 23:59
     event = self._makeOne('2000/10/12 06:00:00', '2000/10/12 18:00:00',
                       whole_day=True)
     self.assertEqual(toDisplay(event),
             {'start_date': 'Oct 12, 2000',
              'start_time' : None,
              'start_iso': '2000-10-12T06:00:00',
              'end_date' : 'Oct 12, 2000',
              'end_time' : None,
              'end_iso': '2000-10-12T18:00:00',
              'same_day' : True,
              'same_time' : False,
             })