Download csv for job added.

Removed check for notifications so download button is always there.
This commit is contained in:
Nicholas Staples
2016-05-23 12:14:12 +01:00
parent 76662e1c84
commit 935f355d5c
3 changed files with 37 additions and 0 deletions

View File

@@ -262,3 +262,27 @@ def test_should_download_notifications_for_a_service(app_,
assert response.status_code == 200
assert response.get_data(as_text=True) == csv_content
assert 'text/csv' in response.headers['Content-Type']
def test_should_download_notifications_for_a_job(app_,
api_user_active,
mock_login,
mock_get_service,
mock_get_job,
mock_get_notifications,
mock_get_template_version,
mock_has_permissions,
fake_uuid):
with app_.test_request_context():
with app_.test_client() as client:
client.login(api_user_active)
response = client.get(url_for(
'main.view_job',
service_id=fake_uuid,
job_id=fake_uuid,
download='csv'))
csv_content = generate_notifications_csv(
mock_get_notifications(fake_uuid, job_id=fake_uuid)['notifications'])
assert response.status_code == 200
assert response.get_data(as_text=True) == csv_content
assert 'text/csv' in response.headers['Content-Type']