generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding new template IDs * Integration test for new template * Adding additional personalisation parameters * updating content for incomplete application notification * Fixing logging --------- Co-authored-by: srh-sloan <[email protected]>
- Loading branch information
Showing
8 changed files
with
106 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ class UnitTestConfig(DefaultConfig): | |
FSD_LOG_LEVEL = logging.DEBUG | ||
|
||
REPLY_TO_EMAILS_WITH_NOTIFY_ID = { | ||
"[email protected]": "10668b8d-9472-4ce8-ae07-4fcc7bf93a9d", | ||
"[email protected]": "100", | ||
"[email protected]": "10668b8d-9472-4ce8-ae07-4fcc7bf93a9d", | ||
"[email protected]": ("25286d9a-8543-41b5-a00f-331b999e51f0"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import pytest | ||
from fsd_utils.config.notify_constants import NotifyConstants | ||
|
||
from app.notification.model.notification import Notification | ||
|
||
|
||
@pytest.mark.skip(reason="Integration test") | ||
@pytest.mark.parametrize( | ||
"template_type,data_to_send", | ||
[ | ||
( | ||
NotifyConstants.TEMPLATE_TYPE_APPLICATION, | ||
{ | ||
"to": "[email protected]", | ||
"full_name": "unit test", | ||
"content": { | ||
NotifyConstants.APPLICATION_FIELD: { | ||
"fund_name": "unit test fund", | ||
"round_name": "unit test round", | ||
"questions_file": "dGhpcyBpcyBhIHRlc3Q=", | ||
"date_submitted": "2024-11-26T11:23:03.000", | ||
"fund_id": "asdf-wer-234-asdf", | ||
"reference": "TEST-ABC", | ||
"language": "en", | ||
"prospectus_url": "https://google.com", | ||
}, | ||
NotifyConstants.MAGIC_LINK_CONTACT_HELP_EMAIL_FIELD: "[email protected]", | ||
}, | ||
}, | ||
), | ||
( | ||
NotifyConstants.TEMPLATE_TYPE_INCOMPLETE_APPLICATION, | ||
{ | ||
"to": "[email protected]", | ||
"full_name": "unit test", | ||
"content": { | ||
NotifyConstants.APPLICATION_FIELD: { | ||
"fund_name": "unit test fund", | ||
"round_name": "unit test round", | ||
"questions_file": "dGhpcyBpcyBhIHRlc3Q=", | ||
"date_submitted": "2024-11-26T11:23:03.000", | ||
"fund_id": "asdf-wer-234-asdf", | ||
"reference": "TEST-ABC", | ||
"language": "en", | ||
"prospectus_url": "https://google.com", | ||
}, | ||
NotifyConstants.MAGIC_LINK_CONTACT_HELP_EMAIL_FIELD: "[email protected]", | ||
}, | ||
}, | ||
), | ||
], | ||
) | ||
def test_send_real_notification(flask_test_client, template_type, data_to_send): | ||
""" | ||
This is an integration test that hits the real notify service. | ||
To make this work, unskip it and add the notify API key to pytest.ini | ||
""" | ||
with flask_test_client.app.app.test_request_context(): | ||
data_to_send["type"] = template_type | ||
_, code = Notification.email_recipient(json_data=data_to_send) | ||
assert code == 200 |