Пример #1
0
def test_issue_15(db):
    """
    This test covers bug from https://github.com/jarekwg/django-apscheduler/issues/15
    """

    storage = DjangoResultStorage()

    srt = datetime.datetime.now()

    job = DjangoJob.objects.create(name="test",
                                   next_run_time=datetime.datetime.now())
    DjangoJobExecution.objects.create(job=job, run_time=serialize_dt(srt))

    storage.get_or_create_job_execution(
        job, mock_compat.Mock(scheduled_run_times=[srt]))
Пример #2
0
def test_issue_15(db):
    """
    This test covers bug from https://github.com/jarekwg/django-apscheduler/issues/15
    """

    storage = DjangoResultStorage()

    srt = datetime.datetime.now()

    job = DjangoJob.objects.create(name="test", next_run_time=datetime.datetime.now())
    DjangoJobExecution.objects.create(
        job=job,
        run_time=serialize_dt(srt)
    )

    storage.get_or_create_job_execution(
        job,
        mock_compat.Mock(scheduled_run_times=[srt])
    )
Пример #3
0
 def __init__(self, storage=None):
     self.storage = storage or DjangoResultStorage()