mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 03:48:12 +08:00
Tests schedule creation via model
This commit is contained in:
@@ -90,6 +90,12 @@ def test_scheduler(r):
|
|||||||
assert schedule is not None
|
assert schedule is not None
|
||||||
assert schedule.last_run() is None
|
assert schedule.last_run() is None
|
||||||
scheduler(list_key=list_key)
|
scheduler(list_key=list_key)
|
||||||
|
# via model
|
||||||
|
Schedule.objects.create(func='django_q.tests.tasks.word_multiply',
|
||||||
|
args='2',
|
||||||
|
kwargs='word="django"',
|
||||||
|
schedule_type=Schedule.DAILY
|
||||||
|
)
|
||||||
scheduler(list_key=list_key)
|
scheduler(list_key=list_key)
|
||||||
# ONCE schedule should be deleted
|
# ONCE schedule should be deleted
|
||||||
assert Schedule.objects.filter(pk=once_schedule.pk).exists() is False
|
assert Schedule.objects.filter(pk=once_schedule.pk).exists() is False
|
||||||
|
|||||||
Reference in New Issue
Block a user