mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 01:53:12 -04:00
The ftp app once updated the status of a job, since we no longer call the task we can delete it.
This commit is contained in:
@@ -7,7 +7,6 @@ from flask import current_app
|
||||
|
||||
from app.exceptions import DVLAException, NotificationTechnicalFailureException
|
||||
from app.models import (
|
||||
Job,
|
||||
Notification,
|
||||
NotificationHistory,
|
||||
NOTIFICATION_CREATED,
|
||||
@@ -21,7 +20,6 @@ from app.celery.tasks import (
|
||||
get_billing_date_in_bst_from_filename,
|
||||
persist_daily_sorted_letter_counts,
|
||||
process_updates_from_file,
|
||||
update_dvla_job_to_error,
|
||||
update_letter_notifications_statuses,
|
||||
update_letter_notifications_to_error,
|
||||
update_letter_notifications_to_sent_to_dvla
|
||||
@@ -41,19 +39,6 @@ def notification_update():
|
||||
return NotificationUpdate('REFERENCE_ABC', 'sent', '1', 'cost')
|
||||
|
||||
|
||||
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 Job.query.filter_by(id=sample_letter_job.id).one().job_status == 'error'
|
||||
|
||||
|
||||
def test_update_letter_notifications_statuses_raises_for_invalid_format(notify_api, mocker):
|
||||
invalid_file = 'ref-foo|Sent|1|Unsorted\nref-bar|Sent|2'
|
||||
mocker.patch('app.celery.tasks.s3.get_s3_file', return_value=invalid_file)
|
||||
|
||||
Reference in New Issue
Block a user