mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 12:39:50 -04:00
Merge pull request #3458 from alphagov/bump-utils-letter-timings
Bump utils to 39.4.2
This commit is contained in:
@@ -134,6 +134,14 @@ def view_notification(service_id, notification_id):
|
|||||||
status='sending,delivered,failed',
|
status='sending,delivered,failed',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if notification['notification_type'] == 'letter':
|
||||||
|
estimated_letter_delivery_date = get_letter_timings(
|
||||||
|
notification['created_at'],
|
||||||
|
postage=notification['postage']
|
||||||
|
).earliest_delivery
|
||||||
|
else:
|
||||||
|
estimated_letter_delivery_date = None
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
'views/notifications/notification.html',
|
'views/notifications/notification.html',
|
||||||
finished=(notification['status'] in (DELIVERED_STATUSES + FAILURE_STATUSES)),
|
finished=(notification['status'] in (DELIVERED_STATUSES + FAILURE_STATUSES)),
|
||||||
@@ -154,10 +162,7 @@ def view_notification(service_id, notification_id):
|
|||||||
created_at=notification['created_at'],
|
created_at=notification['created_at'],
|
||||||
updated_at=notification['updated_at'],
|
updated_at=notification['updated_at'],
|
||||||
help=get_help_argument(),
|
help=get_help_argument(),
|
||||||
estimated_letter_delivery_date=get_letter_timings(
|
estimated_letter_delivery_date=estimated_letter_delivery_date,
|
||||||
notification['created_at'],
|
|
||||||
postage=notification['postage']
|
|
||||||
).earliest_delivery,
|
|
||||||
notification_id=notification['id'],
|
notification_id=notification['id'],
|
||||||
postage=notification['postage'],
|
postage=notification['postage'],
|
||||||
can_receive_inbound=(current_service.has_permission('inbound_sms')),
|
can_receive_inbound=(current_service.has_permission('inbound_sms')),
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ notifications-python-client==5.5.1
|
|||||||
awscli-cwlogs>=1.4,<1.5
|
awscli-cwlogs>=1.4,<1.5
|
||||||
itsdangerous==1.1.0
|
itsdangerous==1.1.0
|
||||||
|
|
||||||
git+https://github.com/alphagov/notifications-utils.git@39.3.0#egg=notifications-utils==39.3.0
|
git+https://github.com/alphagov/notifications-utils.git@39.4.2#egg=notifications-utils==39.4.2
|
||||||
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
|
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ notifications-python-client==5.5.1
|
|||||||
awscli-cwlogs>=1.4,<1.5
|
awscli-cwlogs>=1.4,<1.5
|
||||||
itsdangerous==1.1.0
|
itsdangerous==1.1.0
|
||||||
|
|
||||||
git+https://github.com/alphagov/notifications-utils.git@39.3.0#egg=notifications-utils==39.3.0
|
git+https://github.com/alphagov/notifications-utils.git@39.4.2#egg=notifications-utils==39.4.2
|
||||||
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
|
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:
|
## The following requirements were added by pip freeze:
|
||||||
awscli==1.18.63
|
awscli==1.18.67
|
||||||
bleach==3.1.4
|
bleach==3.1.4
|
||||||
boto3==1.10.38
|
boto3==1.10.38
|
||||||
botocore==1.16.13
|
botocore==1.16.17
|
||||||
certifi==2020.4.5.1
|
certifi==2020.4.5.1
|
||||||
chardet==3.0.4
|
chardet==3.0.4
|
||||||
click==7.1.2
|
click==7.1.2
|
||||||
@@ -67,7 +67,7 @@ redis==3.5.2
|
|||||||
requests==2.23.0
|
requests==2.23.0
|
||||||
rsa==3.4.2
|
rsa==3.4.2
|
||||||
s3transfer==0.3.3
|
s3transfer==0.3.3
|
||||||
six==1.14.0
|
six==1.15.0
|
||||||
smartypants==2.0.1
|
smartypants==2.0.1
|
||||||
statsd==3.3.0
|
statsd==3.3.0
|
||||||
texttable==1.6.2
|
texttable==1.6.2
|
||||||
|
|||||||
@@ -349,13 +349,17 @@ def test_should_show_letter_job(
|
|||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00")
|
@freeze_time("2016-01-01 11:09:00")
|
||||||
def test_should_show_letter_job_with_banner_after_sending_before_1730(
|
def test_should_show_letter_job_with_banner_after_sending_before_1730(
|
||||||
|
mocker,
|
||||||
client_request,
|
client_request,
|
||||||
mock_get_service_letter_template,
|
mock_get_service_letter_template,
|
||||||
mock_get_letter_job,
|
mock_get_letter_job,
|
||||||
mock_get_notifications,
|
|
||||||
mock_get_service_data_retention,
|
mock_get_service_data_retention,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
):
|
):
|
||||||
|
mocker.patch(
|
||||||
|
'app.notification_api_client.get_notifications_for_service',
|
||||||
|
return_value=create_notifications(template_type='letter', postage='second')
|
||||||
|
)
|
||||||
|
|
||||||
page = client_request.get(
|
page = client_request.get(
|
||||||
'main.view_job',
|
'main.view_job',
|
||||||
@@ -373,13 +377,17 @@ def test_should_show_letter_job_with_banner_after_sending_before_1730(
|
|||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00")
|
@freeze_time("2016-01-01 11:09:00")
|
||||||
def test_should_show_letter_job_with_banner_when_there_are_multiple_CSV_rows(
|
def test_should_show_letter_job_with_banner_when_there_are_multiple_CSV_rows(
|
||||||
|
mocker,
|
||||||
client_request,
|
client_request,
|
||||||
mock_get_service_letter_template,
|
mock_get_service_letter_template,
|
||||||
mock_get_letter_job_in_progress,
|
mock_get_letter_job_in_progress,
|
||||||
mock_get_notifications,
|
|
||||||
mock_get_service_data_retention,
|
mock_get_service_data_retention,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
):
|
):
|
||||||
|
mocker.patch(
|
||||||
|
'app.notification_api_client.get_notifications_for_service',
|
||||||
|
return_value=create_notifications(template_type='letter', postage='second')
|
||||||
|
)
|
||||||
|
|
||||||
page = client_request.get(
|
page = client_request.get(
|
||||||
'main.view_job',
|
'main.view_job',
|
||||||
@@ -396,13 +404,17 @@ def test_should_show_letter_job_with_banner_when_there_are_multiple_CSV_rows(
|
|||||||
|
|
||||||
@freeze_time("2016-01-01 18:09:00")
|
@freeze_time("2016-01-01 18:09:00")
|
||||||
def test_should_show_letter_job_with_banner_after_sending_after_1730(
|
def test_should_show_letter_job_with_banner_after_sending_after_1730(
|
||||||
|
mocker,
|
||||||
client_request,
|
client_request,
|
||||||
mock_get_service_letter_template,
|
mock_get_service_letter_template,
|
||||||
mock_get_letter_job,
|
mock_get_letter_job,
|
||||||
mock_get_notifications,
|
|
||||||
mock_get_service_data_retention,
|
mock_get_service_data_retention,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
):
|
):
|
||||||
|
mocker.patch(
|
||||||
|
'app.notification_api_client.get_notifications_for_service',
|
||||||
|
return_value=create_notifications(template_type='letter', postage='second')
|
||||||
|
)
|
||||||
|
|
||||||
page = client_request.get(
|
page = client_request.get(
|
||||||
'main.view_job',
|
'main.view_job',
|
||||||
|
|||||||
@@ -530,13 +530,13 @@ def test_notification_page_does_not_show_cancel_link_for_letter_which_cannot_be_
|
|||||||
'europe',
|
'europe',
|
||||||
'Postage: international',
|
'Postage: international',
|
||||||
'letter-postage-international',
|
'letter-postage-international',
|
||||||
'Estimated delivery date: Wednesday 6 January',
|
'Estimated delivery date: Friday 8 January',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'rest-of-world',
|
'rest-of-world',
|
||||||
'Postage: international',
|
'Postage: international',
|
||||||
'letter-postage-international',
|
'letter-postage-international',
|
||||||
'Estimated delivery date: Wednesday 6 January',
|
'Estimated delivery date: Monday 11 January',
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
@freeze_time("2016-01-01 18:00")
|
@freeze_time("2016-01-01 18:00")
|
||||||
|
|||||||
Reference in New Issue
Block a user