mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 08:21:13 -05:00
Merge pull request #902 from alphagov/task-to-set-job-to-error
Task to set job to error
This commit is contained in:
@@ -12,7 +12,7 @@ from celery.exceptions import Retry
|
||||
from app import (encryption, DATETIME_FORMAT)
|
||||
from app.celery import provider_tasks
|
||||
from app.celery import tasks
|
||||
from app.celery.tasks import s3, build_dvla_file, create_dvla_file_contents
|
||||
from app.celery.tasks import s3, build_dvla_file, create_dvla_file_contents, update_dvla_job_to_error
|
||||
from app.celery.tasks import (
|
||||
process_job,
|
||||
process_row,
|
||||
@@ -1059,3 +1059,16 @@ def test_update_job_to_sent_to_dvla(sample_letter_template, sample_letter_job):
|
||||
assert [(n.status == 'sending', n.sent_by == 'dvla') for n in updated_notifications]
|
||||
|
||||
assert 'sent to dvla' == Job.query.filter_by(id=sample_letter_job.id).one().job_status
|
||||
|
||||
|
||||
def test_update_dvla_job_to_error(sample_letter_template, sample_letter_job):
|
||||
create_notification(template=sample_letter_template, job=sample_letter_job)
|
||||
create_notification(template=sample_letter_template, job=sample_letter_job)
|
||||
update_dvla_job_to_error(job_id=sample_letter_job.id)
|
||||
|
||||
updated_notifications = Notification.query.all()
|
||||
for n in updated_notifications:
|
||||
assert n.status == 'created'
|
||||
assert not n.sent_by
|
||||
|
||||
assert 'error' == Job.query.filter_by(id=sample_letter_job.id).one().job_status
|
||||
|
||||
Reference in New Issue
Block a user