From 90f56353ab32a6f50e86c4794bd6aee6aa169acb Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 8 Jul 2019 09:54:01 +0100 Subject: [PATCH] Always offer option to add new sender MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure why we had this logic. We shouldn’t make you jump over to the settings page if none of the available options are right for this letter. --- .../views/templates/set-template-sender.html | 4 +--- tests/app/main/views/test_templates.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/templates/views/templates/set-template-sender.html b/app/templates/views/templates/set-template-sender.html index e68b99045..75f76f686 100644 --- a/app/templates/views/templates/set-template-sender.html +++ b/app/templates/views/templates/set-template-sender.html @@ -23,9 +23,7 @@ hide_legend=True ) }} {{ page_footer('Continue') }} - {% if no_senders %} - Add new sender - {% endif %} + Add new sender {% endcall %} diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index c1ad1bbca..76ffda615 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -2161,16 +2161,15 @@ def test_set_template_sender( ) -@pytest.mark.parametrize('fixture, add_button_is_on_page', [ - (no_letter_contact_blocks, True), - (single_letter_contact_block, False), +@pytest.mark.parametrize('fixture', [ + no_letter_contact_blocks, + single_letter_contact_block, ]) def test_add_sender_link_only_appears_on_services_with_no_senders( client_request, fake_uuid, mocker, fixture, - add_button_is_on_page, mock_get_service_letter_template, no_letter_contact_blocks ): @@ -2181,4 +2180,8 @@ def test_add_sender_link_only_appears_on_services_with_no_senders( template_id=fake_uuid, ) - assert (page.select_one('.column-three-quarters form > a') is not None) == add_button_is_on_page + assert page.select_one('.column-three-quarters form > a')['href'] == url_for( + 'main.service_add_letter_contact', + service_id=SERVICE_ONE_ID, + from_template=fake_uuid, + )