Merge pull request #959 from alphagov/comma-format-message-limit

Comma-format number when emailing live services
This commit is contained in:
minglis
2017-05-18 11:06:24 +01:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ def update_service(service_id):
template_id=current_app.config['SERVICE_NOW_LIVE_TEMPLATE_ID'], template_id=current_app.config['SERVICE_NOW_LIVE_TEMPLATE_ID'],
personalisation={ personalisation={
'service_name': current_data['name'], 'service_name': current_data['name'],
'message_limit': current_data['message_limit'] 'message_limit': '{:,}'.format(current_data['message_limit'])
}, },
include_user_fields=['name'] include_user_fields=['name']
) )

View File

@@ -1682,7 +1682,15 @@ def test_update_service_calls_send_notification_as_service_becomes_live(notify_d
) )
assert resp.status_code == 200 assert resp.status_code == 200
assert send_notification_mock.called send_notification_mock.assert_called_once_with(
service_id=restricted_service.id,
template_id='618185c6-3636-49cd-b7d2-6f6f5eb3bdde',
personalisation={
'service_name': restricted_service.name,
'message_limit': '1,000'
},
include_user_fields=['name']
)
def test_update_service_does_not_call_send_notification_for_live_service(sample_service, client, mocker): def test_update_service_does_not_call_send_notification_for_live_service(sample_service, client, mocker):