mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
fixed tests that used the new state.
This commit is contained in:
@@ -1060,6 +1060,8 @@ def test_update_dvla_job_to_error(sample_letter_template, sample_letter_job):
|
|||||||
update_dvla_job_to_error(job_id=sample_letter_job.id)
|
update_dvla_job_to_error(job_id=sample_letter_job.id)
|
||||||
|
|
||||||
updated_notifications = Notification.query.all()
|
updated_notifications = Notification.query.all()
|
||||||
assert [(n.status == 'created', n.sent_by == 'dvla') for n in updated_notifications]
|
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
|
assert 'error' == Job.query.filter_by(id=sample_letter_job.id).one().job_status
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ def test_get_jobs_accepts_page_parameter(
|
|||||||
@pytest.mark.parametrize('statuses_filter, expected_statuses', [
|
@pytest.mark.parametrize('statuses_filter, expected_statuses', [
|
||||||
('', JOB_STATUS_TYPES),
|
('', JOB_STATUS_TYPES),
|
||||||
('pending', [JOB_STATUS_PENDING]),
|
('pending', [JOB_STATUS_PENDING]),
|
||||||
('pending, in progress, finished, sending limits exceeded, scheduled, cancelled, ready to send, sent to dvla',
|
('pending, in progress, finished, sending limits exceeded, scheduled, cancelled, ready to send, sent to dvla, error', # noqa
|
||||||
JOB_STATUS_TYPES),
|
JOB_STATUS_TYPES),
|
||||||
# bad statuses are accepted, just return no data
|
# bad statuses are accepted, just return no data
|
||||||
('foo', [])
|
('foo', [])
|
||||||
@@ -694,6 +694,7 @@ def test_get_jobs_can_filter_on_statuses(
|
|||||||
create_job(notify_db, notify_db_session, job_status='cancelled')
|
create_job(notify_db, notify_db_session, job_status='cancelled')
|
||||||
create_job(notify_db, notify_db_session, job_status='ready to send')
|
create_job(notify_db, notify_db_session, job_status='ready to send')
|
||||||
create_job(notify_db, notify_db_session, job_status='sent to dvla')
|
create_job(notify_db, notify_db_session, job_status='sent to dvla')
|
||||||
|
create_job(notify_db, notify_db_session, job_status='error')
|
||||||
|
|
||||||
path = '/service/{}/job'.format(sample_service.id)
|
path = '/service/{}/job'.format(sample_service.id)
|
||||||
response = client.get(
|
response = client.get(
|
||||||
|
|||||||
Reference in New Issue
Block a user