mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
Download csv for job added.
Removed check for notifications so download button is always there.
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user