mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Merge pull request #640 from alphagov/scheduled-delivery-of-jobs-cleanup
Scheduled delivery of jobs cleanup
This commit is contained in:
@@ -215,15 +215,15 @@ def test_get_jobs_for_service_in_created_at_order(notify_db, notify_db_session,
|
||||
|
||||
|
||||
def test_update_job(sample_job):
|
||||
assert sample_job.status == 'pending'
|
||||
assert sample_job.job_status == 'pending'
|
||||
|
||||
sample_job.status = 'in progress'
|
||||
sample_job.job_status = 'in progress'
|
||||
|
||||
dao_update_job(sample_job)
|
||||
|
||||
job_from_db = Job.query.get(sample_job.id)
|
||||
|
||||
assert job_from_db.status == 'in progress'
|
||||
assert job_from_db.job_status == 'in progress'
|
||||
|
||||
|
||||
def test_get_scheduled_jobs_gets_all_jobs_in_scheduled_state_scheduled_before_now(notify_db, notify_db_session):
|
||||
|
||||
@@ -139,8 +139,8 @@ def test_create_unscheduled_job(notify_api, sample_template, mocker, fake_uuid):
|
||||
resp_json = json.loads(response.get_data(as_text=True))
|
||||
|
||||
assert resp_json['data']['id'] == fake_uuid
|
||||
assert resp_json['data']['status'] == 'pending'
|
||||
assert resp_json['data']['statistics'] == []
|
||||
assert resp_json['data']['job_status'] == 'pending'
|
||||
assert not resp_json['data']['scheduled_for']
|
||||
assert resp_json['data']['job_status'] == 'pending'
|
||||
assert resp_json['data']['template'] == str(sample_template.id)
|
||||
@@ -177,8 +177,6 @@ def test_create_scheduled_job(notify_api, sample_template, mocker, fake_uuid):
|
||||
resp_json = json.loads(response.get_data(as_text=True))
|
||||
|
||||
assert resp_json['data']['id'] == fake_uuid
|
||||
assert resp_json['data']['statistics'] == []
|
||||
assert resp_json['data']['status'] == 'pending'
|
||||
assert resp_json['data']['scheduled_for'] == datetime(2016, 1, 2, 11, 59, 0,
|
||||
tzinfo=pytz.UTC).isoformat()
|
||||
assert resp_json['data']['job_status'] == 'scheduled'
|
||||
|
||||
Reference in New Issue
Block a user