Hide download CSV link when in the tour

There is really no point to downloading the CSV file of delivery
info when you’re in the tour. It’s just distracting at this point.
This commit is contained in:
Chris Hill-Scott
2016-07-01 11:37:09 +01:00
parent dfbd6610cb
commit d71269ca87
2 changed files with 29 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
<div class="dashboard-table">
{% endif %}
{% if notifications %}
{% if notifications and request.args.get('help', '0') == '0' %}
<p class="bottom-gutter">
<a href="{{ url_for('.view_job_csv', service_id=current_service.id, job_id=job.id, status=status) }}" download="download" class="heading-small">Download as a CSV file</a>
&emsp;

View File

@@ -99,6 +99,34 @@ def test_should_show_page_for_one_job(
)
def test_should_show_not_show_csv_download_in_tour(
app_,
service_one,
active_user_with_permissions,
mock_get_service_template,
mock_get_service_statistics,
mock_get_job,
mocker,
mock_get_notifications,
fake_uuid
):
with app_.test_request_context(), app_.test_client() as client:
client.login(active_user_with_permissions, mocker, service_one)
response = client.get(url_for(
'main.view_job',
service_id=service_one['id'],
job_id=fake_uuid,
help=3
))
assert response.status_code == 200
assert url_for(
'main.view_job_csv',
service_id=service_one['id'],
job_id=fake_uuid
) not in response.get_data(as_text=True)
@freeze_time("2016-01-01 11:09:00.061258")
def test_should_show_updates_for_one_job_as_json(
app_,