def test_event_starting_on_midnight(): """Test that events starting on midnight are properly formatted.""" event = Event(start_date=dt.date(2015, 4, 1), start_time=dt.time(0), end_date=dt.date(2015, 4, 1), end_time=dt.time(5, 30)) assert not event.is_multiday() assert event.human_readable_date() == "Wednesday, April 1" assert event.human_readable_time() == "12-5:30am"
def test_event_ending_on_midnight(): """Test that events ending on midnight are properly formatted.""" start_date, start_time = dt.date(2015, 3, 31), dt.time(22) end_date, end_time = dt.date(2015, 4, 1), dt.time(0) event = Event(start_date=start_date, start_time=start_time, end_date=end_date, end_time=end_time) assert not event.is_multiday() assert event.human_readable_date() == "Tuesday, March 31" assert event.human_readable_time() == "10pm-12am"
def test_event_starting_on_midnight(self): """Test that events starting on midnight are properly formatted.""" from eventum.models import Event start_date, start_time = date(2015, 04, 01), time(00) end_date, end_time = date(2015, 04, 01), time(05, 30) event = Event(start_date=start_date, start_time=start_time, end_date=end_date, end_time=end_time, **self.EVENT_KWARGS) self.assertFalse(event.is_multiday()) self.assertEqual(event.human_readable_date(), 'Wednesday, April 1') self.assertEqual(event.human_readable_time(), '12-5:30am')
def test_event_ending_on_midnight(self): """Test that events ending on midnight are properly formatted.""" from eventum.models import Event start_date, start_time = date(2015, 03, 31), time(22) end_date, end_time = date(2015, 04, 01), time(0) event = Event(start_date=start_date, start_time=start_time, end_date=end_date, end_time=end_time, **self.EVENT_KWARGS) self.assertFalse(event.is_multiday()) self.assertEqual(event.human_readable_date(), 'Tuesday, March 31') self.assertEqual(event.human_readable_time(), '10pm-12am')