Skip to content

Commit

Permalink
Updating template ID for welsh translation
Browse files Browse the repository at this point in the history
Added unit test for welsh template
  • Loading branch information
srh-sloan committed Jan 7, 2025
1 parent 9303b09 commit 12bcc9f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/notify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class NotificationService:
"APPLICATION_SUBMISSION_TEMPLATE_ID_EN", "6adbba70-2fde-4ca7-94cb-7f7eb264efaa"
)
APPLICATION_SUBMISSION_TEMPLATE_ID_CY = os.environ.get(
"APPLICATION_SUBMISSION_TEMPLATE_ID_CY", "6adbba70-2fde-4ca7-94cb-7f7eb264efaa"
) # TODO update once translation received
"APPLICATION_SUBMISSION_TEMPLATE_ID_CY", "60bb6baa-0ef9-4059-954e-7c2744e6c63a"
)

APPLICATION_INCOMPLETE_TEMPLATE_ID = os.environ.get(
"APPLICATION_INCOMPLETE_TEMPLATE_ID", "944cb37d-c9e0-4731-88f5-d752514da57f"
Expand Down
46 changes: 46 additions & 0 deletions tests/test_services/test_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,52 @@ def test_send_submit_application_email(self, app):
assert resp == Notification(id=uuid.UUID("00000000-0000-0000-0000-000000000003"))
assert request_matcher.call_count == 1

@responses.activate
def test_send_submit_application_email_welsh(self, app):
request_matcher = responses.post(
url="https://api.notifications.service.gov.uk/v2/notifications/email",
status=201,
match=[
matchers.json_params_matcher(
{
"email_address": "[email protected]",
"template_id": "60bb6baa-0ef9-4059-954e-7c2744e6c63a",
"personalisation": {
"name of fund": "COF-EOI",
"application reference": "app-123",
"date submitted": "10 February 2024 at 10:00am",
"round name": "test round",
"question": {
"file": "YWJjMTIz",
"filename": None,
"confirm_email_before_download": None,
"retention_period": None,
},
"URL of prospectus": "https://prospectus",
"contact email": "[email protected]",
},
"reference": "abc123",
}
)
],
json={"id": "00000000-0000-0000-0000-000000000003"}, # partial GOV.UK Notify response
)

resp = get_notification_service().send_submit_application_email(
"[email protected]",
language="cy",
fund_name="COF-EOI",
application_reference="app-123",
submission_date="2024-02-10T10:00:00.000000",
round_name="test round",
questions="YWJjMTIz",
prospectus_url="https://prospectus",
contact_help_email="[email protected]",
govuk_notify_reference="abc123",
)
assert resp == Notification(id=uuid.UUID("00000000-0000-0000-0000-000000000003"))
assert request_matcher.call_count == 1

@responses.activate
def test_send_application_deadline_reminder_email(self, app):
request_matcher = responses.post(
Expand Down

0 comments on commit 12bcc9f

Please sign in to comment.