From c3b2017f47302c95dc1e15a4af18efdf4c0e82ea Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 13 Nov 2019 13:29:49 +0000 Subject: [PATCH] =?UTF-8?q?Comma-delimit=20thousands=20in=20=E2=80=98Send?= =?UTF-8?q?=E2=80=99=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches the style of how we display numbers in the thousands elsewhere. --- app/templates/views/check/ok.html | 2 +- tests/app/main/views/test_send.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/templates/views/check/ok.html b/app/templates/views/check/ok.html index 9ecc6387c..3f665d683 100644 --- a/app/templates/views/check/ok.html +++ b/app/templates/views/check/ok.html @@ -45,7 +45,7 @@ ) }} {% endif %} {% if (template.template_type != 'letter' or not request.args.from_test) and not letter_too_long %} - + {% else %} Download as a PDF {% endif %} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 913299f14..8846ebdca 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -2162,6 +2162,36 @@ def test_letter_can_only_be_sent_now( ) +def test_send_button_is_correctly_labelled( + client_request, + mocker, + mock_get_live_service, + mock_get_service_template, + mock_get_users_by_service, + mock_get_service_statistics, + mock_get_job_doesnt_exist, + mock_get_jobs, + fake_uuid, +): + mocker.patch('app.main.views.send.s3download', return_value='\n'.join( + ['phone_number'] + (['07900900123'] * 1000) + )) + mocker.patch('app.main.views.send.set_metadata_on_csv_upload') + + page = client_request.get( + 'main.check_messages', + service_id=SERVICE_ONE_ID, + upload_id=fake_uuid, + template_id=fake_uuid, + ) + + assert normalize_spaces( + page.select_one('[type=submit]').text + ) == ( + 'Send 1,000 text messages' + ) + + @pytest.mark.parametrize('when', [ '', '2016-08-25T13:04:21.767198' ])