mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 17:28:12 +08:00
Trigger cron validation
This commit is contained in:
@@ -3,6 +3,7 @@ from multiprocessing import Event, Value
|
||||
|
||||
import arrow
|
||||
import pytest
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import IntegrityError
|
||||
from django.utils import timezone
|
||||
|
||||
@@ -100,6 +101,12 @@ def test_scheduler(broker, monkeypatch):
|
||||
assert hasattr(cron_schedule, 'pk') is True
|
||||
assert cron_schedule.full_clean() is None
|
||||
assert cron_schedule.__unicode__() == 'django_q.tests.tasks.word_multiply'
|
||||
with pytest.raises(ValidationError):
|
||||
cron_schedule = create_schedule('django_q.tests.tasks.word_multiply',
|
||||
2,
|
||||
word='django',
|
||||
schedule_type=Schedule.CRON,
|
||||
cron="0 22 * * 1-12")
|
||||
# All other types
|
||||
for t in Schedule.TYPE:
|
||||
if t[0] == Schedule.CRON:
|
||||
|
||||
Reference in New Issue
Block a user