本文整理汇总了Python中app.models.Event.is_multiday方法的典型用法代码示例。如果您正苦于以下问题:Python Event.is_multiday方法的具体用法?Python Event.is_multiday怎么用?Python Event.is_multiday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.models.Event
的用法示例。
在下文中一共展示了Event.is_multiday方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_event_starting_on_midnight
# 需要导入模块: from app.models import Event [as 别名]
# 或者: from app.models.Event import is_multiday [as 别名]
def test_event_starting_on_midnight(self):
"""Test that events starting on midnight are properly formatted."""
from app.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')
示例2: test_event_ending_on_midnight
# 需要导入模块: from app.models import Event [as 别名]
# 或者: from app.models.Event import is_multiday [as 别名]
def test_event_ending_on_midnight(self):
"""Test that events ending on midnight are properly formatted."""
from app.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')