本文整理汇总了Python中app.models.Event.end_datetime方法的典型用法代码示例。如果您正苦于以下问题:Python Event.end_datetime方法的具体用法?Python Event.end_datetime怎么用?Python Event.end_datetime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.models.Event
的用法示例。
在下文中一共展示了Event.end_datetime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_event_end_datetimes_none_with_incomplete_data
# 需要导入模块: from app.models import Event [as 别名]
# 或者: from app.models.Event import end_datetime [as 别名]
def test_event_end_datetimes_none_with_incomplete_data(self):
"""Test that when events are created without both of end_date and
end_time, end_datetime() returns None.
"""
e = Event(title=self.TITLE, creator=self.USER,
end_date=self.END.date())
self.assertIsNone(e.end_datetime())
f = Event(title=self.TITLE, creator=self.USER,
end_time=self.END.time())
self.assertIsNone(f.end_datetime())
示例2: test_event_end_datetimes
# 需要导入模块: from app.models import Event [as 别名]
# 或者: from app.models.Event import end_datetime [as 别名]
def test_event_end_datetimes(self):
"""Test that when events are created with both end_date and
end_time, end_datetime() is their value combined.
"""
e = Event(title=self.TITLE, creator=self.USER,
end_date=self.END.date(),
end_time=self.END.time())
self.assertEqual(e.end_datetime(), self.END)