mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 00:48:12 +08:00
Removing value check
This commit is contained in:
@@ -138,8 +138,6 @@ class Failure(Task):
|
|||||||
|
|
||||||
# Optional Cron validator
|
# Optional Cron validator
|
||||||
def validate_cron(value):
|
def validate_cron(value):
|
||||||
if not value:
|
|
||||||
return
|
|
||||||
if not croniter:
|
if not croniter:
|
||||||
raise ImportError(_("Please install croniter to enable cron expressions"))
|
raise ImportError(_("Please install croniter to enable cron expressions"))
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -102,11 +102,11 @@ def test_scheduler(broker, monkeypatch):
|
|||||||
assert cron_schedule.full_clean() is None
|
assert cron_schedule.full_clean() is None
|
||||||
assert cron_schedule.__unicode__() == 'django_q.tests.tasks.word_multiply'
|
assert cron_schedule.__unicode__() == 'django_q.tests.tasks.word_multiply'
|
||||||
with pytest.raises(ValidationError):
|
with pytest.raises(ValidationError):
|
||||||
cron_schedule = create_schedule('django_q.tests.tasks.word_multiply',
|
create_schedule('django_q.tests.tasks.word_multiply',
|
||||||
2,
|
2,
|
||||||
word='django',
|
word='django',
|
||||||
schedule_type=Schedule.CRON,
|
schedule_type=Schedule.CRON,
|
||||||
cron="0 22 * * 1-12")
|
cron="0 22 * * 1-12")
|
||||||
# All other types
|
# All other types
|
||||||
for t in Schedule.TYPE:
|
for t in Schedule.TYPE:
|
||||||
if t[0] == Schedule.CRON:
|
if t[0] == Schedule.CRON:
|
||||||
|
|||||||
Reference in New Issue
Block a user