当前位置: 首页>>代码示例>>Python>>正文


Python Calendar.occurrences_after方法代码示例

本文整理汇总了Python中schedule.models.Calendar.occurrences_after方法的典型用法代码示例。如果您正苦于以下问题:Python Calendar.occurrences_after方法的具体用法?Python Calendar.occurrences_after怎么用?Python Calendar.occurrences_after使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在schedule.models.Calendar的用法示例。


在下文中一共展示了Calendar.occurrences_after方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_occurrences_after_with_events_before_returns_empty

# 需要导入模块: from schedule.models import Calendar [as 别名]
# 或者: from schedule.models.Calendar import occurrences_after [as 别名]
 def test_occurrences_after_with_events_before_returns_empty(self):
     calendar = Calendar()
     calendar.save()
     start_after = timezone.now() + datetime.timedelta(days=-1)
     end_after = start_after + datetime.timedelta(hours=1)
     event = self.__create_event(start_after, end_after)
     calendar.events.add(event)
     occurrences = list(calendar.occurrences_after(timezone.now()))
     self.assertEqual(occurrences, [])
开发者ID:JoshLabs,项目名称:django-scheduler,代码行数:11,代码来源:test_calendar.py

示例2: test_occurrences_after_with_events_after_returns_events

# 需要导入模块: from schedule.models import Calendar [as 别名]
# 或者: from schedule.models.Calendar import occurrences_after [as 别名]
 def test_occurrences_after_with_events_after_returns_events(self):
     calendar = Calendar()
     calendar.save()
     start_after = timezone.now() + datetime.timedelta(days=1)
     end_after = start_after + datetime.timedelta(hours=1)
     event = self.__create_event(start_after, end_after)
     calendar.events.add(event)
     occurrences = list(calendar.occurrences_after(timezone.now()))
     self.assertEquals(len(occurrences), 1)
     self.assertEquals(occurrences[0].start, start_after)
     self.assertEquals(occurrences[0].end, end_after)
开发者ID:AltSchool,项目名称:django-scheduler,代码行数:13,代码来源:test_calendar.py

示例3: test_occurrences_after_without_events_is_empty

# 需要导入模块: from schedule.models import Calendar [as 别名]
# 或者: from schedule.models.Calendar import occurrences_after [as 别名]
 def test_occurrences_after_without_events_is_empty(self):
     calendar = Calendar()
     self.assertEqual(list(calendar.occurrences_after(timezone.now())), [])
开发者ID:Alcolo47,项目名称:django-scheduler,代码行数:5,代码来源:test_calendar.py


注:本文中的schedule.models.Calendar.occurrences_after方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。