Пример #1
0
 def get_next_run_time(self):
     try:
         job = DjangoJob.objects.filter(
             next_run_time__isnull=False).earliest("next_run_time")
         return get_apscheduler_datetime(job.next_run_time, self._scheduler)
     except DjangoJob.DoesNotExist:
         # No active jobs - OK
         return None
Пример #2
0
def test_get_apscheduler_datetime(scheduler):
    apscheduler_dt = util.get_apscheduler_datetime(datetime.now(), scheduler)

    assert timezone.is_aware(apscheduler_dt)