mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 05:30:21 -04:00
Make developer instructions more explicit
The previous ‘you need to update your API calls’ text isn’t clear enough now that the context of the spreadsheet has been removed.
This commit is contained in:
@@ -1476,21 +1476,22 @@ def test_should_403_when_create_template_with_process_type_of_priority_for_non_p
|
||||
mock_update_service_template.called == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize('template_mock, template_type, expected_paragraphs', [
|
||||
@pytest.mark.parametrize('old_content, new_content, expected_paragraphs', [
|
||||
(
|
||||
mock_get_service_email_template,
|
||||
"email",
|
||||
"my favourite colour is blue",
|
||||
"my favourite colour is ((colour))",
|
||||
[
|
||||
'You removed ((date))',
|
||||
'You added ((name))',
|
||||
'You added ((colour))',
|
||||
'Before you send any messages, make sure your API calls include colour.',
|
||||
]
|
||||
),
|
||||
(
|
||||
mock_get_service_letter_template,
|
||||
"letter",
|
||||
"hello ((name))",
|
||||
"hello ((full name))",
|
||||
[
|
||||
'You removed ((date))',
|
||||
'You added ((name))',
|
||||
'You removed ((name))',
|
||||
'You added ((full name))',
|
||||
'Before you send any messages, make sure your API calls include full name.',
|
||||
]
|
||||
),
|
||||
])
|
||||
@@ -1501,28 +1502,25 @@ def test_should_show_interstitial_when_making_breaking_change(
|
||||
mock_get_api_keys,
|
||||
fake_uuid,
|
||||
mocker,
|
||||
template_mock,
|
||||
template_type,
|
||||
new_content,
|
||||
old_content,
|
||||
expected_paragraphs,
|
||||
):
|
||||
template_mock(
|
||||
mock_get_service_email_template(
|
||||
mocker,
|
||||
subject="Your ((thing)) is due soon",
|
||||
content="Your vehicle tax expires on ((date))",
|
||||
content=old_content,
|
||||
)
|
||||
data = {
|
||||
'id': fake_uuid,
|
||||
'name': "new name",
|
||||
'template_content': "hello lets talk about ((thing))",
|
||||
'template_type': template_type,
|
||||
'subject': 'reminder \'" <span> & ((name))',
|
||||
'template_content': new_content,
|
||||
'template_type': 'email',
|
||||
'subject': 'reminder \'" <span> & ((thing))',
|
||||
'service': SERVICE_ONE_ID,
|
||||
'process_type': 'normal'
|
||||
}
|
||||
|
||||
if template_type == "letter":
|
||||
data["postage"] = 'None'
|
||||
|
||||
page = client_request.post(
|
||||
'.edit_service_template',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
@@ -1537,13 +1535,14 @@ def test_should_show_interstitial_when_making_breaking_change(
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
)
|
||||
for index, p in enumerate(expected_paragraphs):
|
||||
assert normalize_spaces(page.select('main p')[index].text) == p
|
||||
assert [
|
||||
normalize_spaces(paragraph.text) for paragraph in page.select('main p')
|
||||
] == expected_paragraphs
|
||||
|
||||
for key, value in {
|
||||
'name': 'new name',
|
||||
'subject': 'reminder \'" <span> & ((name))',
|
||||
'template_content': 'hello lets talk about ((thing))',
|
||||
'subject': 'reminder \'" <span> & ((thing))',
|
||||
'template_content': new_content,
|
||||
'confirm': 'true'
|
||||
}.items():
|
||||
assert page.find('input', {'name': key})['value'] == value
|
||||
@@ -1551,7 +1550,7 @@ def test_should_show_interstitial_when_making_breaking_change(
|
||||
# BeautifulSoup returns the value attribute as unencoded, let’s make
|
||||
# sure that it is properly encoded in the HTML
|
||||
assert str(page.find('input', {'name': 'subject'})) == (
|
||||
"""<input name="subject" type="hidden" value="reminder '" <span> & ((name))"/>"""
|
||||
"""<input name="subject" type="hidden" value="reminder '" <span> & ((thing))"/>"""
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user