Пример #1
0
 def test_prep_display_with_time(self):
     event_id = self.portal.invokeFactory('Event',
             id="event",
             startDate='2000/10/12 06:00:00',
             endDate='2000/10/12 18:00:00',
             timezone="Europe/Vienna")
     event = self.portal[event_id]
     self.assertEqual(prepare_for_display(self.portal,
         event.start_date, event.end_date, event.whole_day),
             {'start_date': u'Oct 12, 2000',
              'start_time': u'06:00 AM',
              'start_iso':  u'2000-10-12T06:00:00+02:00',
              'end_date':   u'Oct 12, 2000',
              'end_time':   u'06:00 PM',
              'end_iso':    u'2000-10-12T18:00:00+02:00',
              'same_day':   True,
              'same_time':  False,
             })
Пример #2
0
 def test_prep_display_wholeday_differentdays(self):
     event_id = self.portal.invokeFactory('Event',
             id="event",
             startDate='2000/10/12 06:00:00',
             endDate='2000/10/13 18:00:00',
             timezone="Europe/Vienna",
             wholeDay=True)
     event = self.portal[event_id]
     self.assertEqual(prepare_for_display(self.portal,
         event.start_date, event.end_date, event.whole_day),
             {'start_date': u'Oct 12, 2000',
              'start_time': None,
              'start_iso':  u'2000-10-12T00:00:00+02:00',
              'end_date':   u'Oct 13, 2000',
              'end_time':   None,
              'end_iso':    u'2000-10-13T23:59:59+02:00',
              'same_day':   False,
              'same_time':  False,
             })