diff --git a/requirements-app.txt b/requirements-app.txt index bba6433f8..bde474e77 100644 --- a/requirements-app.txt +++ b/requirements-app.txt @@ -23,5 +23,5 @@ awscli-cwlogs>=1.4,<1.5 # Putting upgrade on hold due to v1.0.0 using sha512 instead of sha1 by default itsdangerous==0.24 # pyup: <1.0.0 -git+https://github.com/alphagov/notifications-utils.git@36.4.1#egg=notifications-utils==36.4.1 +git+https://github.com/alphagov/notifications-utils.git@36.6.0#egg=notifications-utils==36.6.0 git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha diff --git a/requirements.txt b/requirements.txt index c24d50f46..c4d3fdf2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,14 +25,14 @@ awscli-cwlogs>=1.4,<1.5 # Putting upgrade on hold due to v1.0.0 using sha512 instead of sha1 by default itsdangerous==0.24 # pyup: <1.0.0 -git+https://github.com/alphagov/notifications-utils.git@36.4.1#egg=notifications-utils==36.4.1 +git+https://github.com/alphagov/notifications-utils.git@36.6.0#egg=notifications-utils==36.6.0 git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha ## The following requirements were added by pip freeze: -awscli==1.17.6 +awscli==1.17.9 bleach==3.1.0 boto3==1.10.38 -botocore==1.14.6 +botocore==1.14.9 certifi==2019.11.28 chardet==3.0.4 Click==7.0 @@ -46,7 +46,7 @@ future==0.18.2 greenlet==0.4.15 idna==2.8 jdcal==1.4.1 -Jinja2==2.10.3 +Jinja2==2.11.0 jmespath==0.9.4 lml==0.0.9 lxml==4.4.2 @@ -66,14 +66,14 @@ PyYAML==5.2 redis==3.3.11 requests==2.22.0 rsa==3.4.2 -s3transfer==0.3.1 +s3transfer==0.3.2 six==1.14.0 smartypants==2.0.1 statsd==3.3.0 texttable==1.6.2 -urllib3==1.25.7 +urllib3==1.25.8 webencodings==0.5.1 -Werkzeug==0.16.0 +Werkzeug==0.16.1 WTForms==2.2.1 xlrd==1.2.0 xlwt==1.3.0 diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index f6e9b0ea4..2a9e7b69e 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -7,7 +7,7 @@ from flask import url_for from freezegun import freeze_time from app.main.views.jobs import get_time_left -from tests import job_json, notification_json, sample_uuid +from tests import job_json, notification_json, sample_uuid, user_json from tests.conftest import ( SERVICE_ONE_ID, create_active_caseworking_user, @@ -768,6 +768,40 @@ def test_should_show_updates_for_one_job_as_json( assert 'Sent by Test User on 1 January at midnight' in content['status'] +@freeze_time("2016-01-01 00:00:00.000001") +def test_should_show_updates_for_scheduled_job_as_json( + logged_in_client, + service_one, + active_user_with_permissions, + mock_get_notifications, + mock_get_service_template, + mock_get_service_data_retention, + mocker, + fake_uuid, +): + mocker.patch('app.job_api_client.get_job', return_value={'data': job_json( + service_one['id'], + created_by=user_json(), + job_id=fake_uuid, + scheduled_for='2016-06-01T13:00:00', + processing_started='2016-06-01T15:00:00', + )}) + + response = logged_in_client.get(url_for('main.view_job_updates', service_id=service_one['id'], job_id=fake_uuid)) + + assert response.status_code == 200 + content = response.json + assert 'sending' in content['counts'] + assert 'delivered' in content['counts'] + assert 'failed' in content['counts'] + assert 'Recipient' in content['notifications'] + assert '07123456789' in content['notifications'] + assert 'Status' in content['notifications'] + assert 'Delivered' in content['notifications'] + assert '12:01am' in content['notifications'] + assert 'Sent by Test User on 1 June at 5:00pm' in content['status'] + + @pytest.mark.parametrize( "job_created_at, expected_message", [ ("2016-01-10 11:09:00.000000+00:00", "Data available for 7 days"),