Stop live services requesting to go live

Live services shouldn't be able to request to go live again. Once a
service is live we remove the option to go live from the Settings page,
but we still link to the page to request to go live from other places
e.g. the 'Get started' page. As a result, we've seen some services make
another request to go live when their service has already been live for
months - this change will stop that from happening.
This commit is contained in:
Katie Smith
2020-11-05 16:45:54 +00:00
parent 9ab3cb1d99
commit 1d1973050d
3 changed files with 53 additions and 0 deletions

View File

@@ -1037,6 +1037,28 @@ def test_should_not_show_go_live_button_if_checklist_not_complete(
)
@pytest.mark.parametrize('go_live_at, message', [
(None, 'service one is already live.'),
('2020-10-09 13:55:20', 'service one went live on 9 October 2020.'),
])
def test_request_to_go_live_redirects_if_service_already_live(
client_request,
service_one,
go_live_at,
message,
):
service_one['restricted'] = False
service_one['go_live_at'] = go_live_at
page = client_request.get(
'main.request_to_go_live',
service_id=SERVICE_ONE_ID,
)
assert page.h1.text == 'Your service is already live'
assert normalize_spaces(page.select_one('main p').text) == message
@pytest.mark.parametrize((
'estimated_sms_volume,'
'organisation_type,'