Add details of MOU signatory to go live ticket

This will help us monitor organisations that have signed our MOU using a
shared inbox and prevent it happening in future.

https://www.pivotaltracker.com/story/show/179782040
This commit is contained in:
Chris Hill-Scott
2021-10-11 14:58:28 +01:00
parent fad3ff70f2
commit ec703c5998
4 changed files with 75 additions and 1 deletions

View File

@@ -1853,6 +1853,67 @@ def test_request_to_go_live_displays_go_live_notes_in_zendesk_ticket(
mock_send_ticket_to_zendesk.assert_called_once()
def test_request_to_go_live_displays_mou_signatories(
client_request,
mocker,
fake_uuid,
active_user_with_permissions,
single_reply_to_email_address,
single_letter_contact_block,
mock_get_organisations_and_services_for_user,
single_sms_sender,
mock_get_service_organisation,
mock_get_service_settings_page_common,
mock_get_service_templates,
mock_get_users_by_service,
mock_update_service,
mock_get_invites_without_manage_permission,
):
mocker.patch(
'app.organisations_client.get_organisation',
side_effect=lambda org_id: organisation_json(
ORGANISATION_ID,
'Org 1',
agreement_signed=True,
agreement_signed_by_id=fake_uuid,
agreement_signed_on_behalf_of_email_address='bigdog@example.gov.uk',
)
)
mocker.patch(
'app.main.views.service_settings.zendesk_client.send_ticket_to_zendesk',
autospec=True,
)
mock_create_ticket = mocker.spy(NotifySupportTicket, '__init__')
client_request.post(
'main.request_to_go_live',
service_id=SERVICE_ONE_ID,
_follow_redirects=True
)
assert mock_create_ticket.call_args[1]['message'] == (
'Service: service one\n'
f'http://localhost/services/{SERVICE_ONE_ID}\n'
'\n'
'---\n'
'Organisation type: Central government\n'
'Agreement signed: Yes, on behalf of Org 1.\n'
'Agreement signed by: test@user.gov.uk\n'
'Agreement signed on behalf of: bigdog@example.gov.uk\n'
'\n'
'Emails in next year: 111,111\n'
'Text messages in next year: 222,222\n'
'Letters in next year: 333,333\n'
'\n'
'Consent to research: Yes\n'
'Other live services for that user: No\n'
'\n'
'Service reply-to address: test@example.com\n'
'\n'
'---\n'
'Request sent by test@user.gov.uk\n'
)
def test_should_be_able_to_request_to_go_live_with_no_organisation(
client_request,
mocker,