mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Don’t show cancelled jobs anywhere
The information about a job doesn’t make sense if a job is cancelled. We could change the information to reflect that the job won’t be sent/ wasn’t sent/was cancelled, but there’s nothing you can really do with this info. So instead let’s: - hide cancelled jobs from the dashboard - hide cancelled jobs from the jobs page - 404 the page if the user tries to click back enough times to hit the job page
This commit is contained in:
@@ -872,6 +872,20 @@ def mock_get_scheduled_job(mocker, api_user_active):
|
||||
return mocker.patch('app.job_api_client.get_job', side_effect=_get_job)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_cancelled_job(mocker, api_user_active):
|
||||
def _get_job(service_id, job_id):
|
||||
return {"data": job_json(
|
||||
service_id,
|
||||
api_user_active,
|
||||
job_id=job_id,
|
||||
job_status='cancelled',
|
||||
scheduled_for='2016-01-01T00:00:00.061258'
|
||||
)}
|
||||
|
||||
return mocker.patch('app.job_api_client.get_job', side_effect=_get_job)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_job_in_progress(mocker, api_user_active):
|
||||
def _get_job(service_id, job_id):
|
||||
@@ -903,7 +917,8 @@ def mock_get_jobs(mocker, api_user_active):
|
||||
("applicants.ods", '', ''),
|
||||
("thisisatest.csv", '', ''),
|
||||
("send_me_later.csv", '2016-01-01 11:09:00.061258', 'scheduled'),
|
||||
("even_later.csv", '2016-01-01 23:09:00.061258', 'scheduled')
|
||||
("even_later.csv", '2016-01-01 23:09:00.061258', 'scheduled'),
|
||||
("full_of_regret.csv", '2016-01-01 23:09:00.061258', 'cancelled')
|
||||
)
|
||||
]}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user