mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
remove xfail
This commit is contained in:
@@ -169,12 +169,6 @@ def test_send_notification_with_placeholders_replaced(notify_api, sample_email_t
|
|||||||
),
|
),
|
||||||
'6',
|
'6',
|
||||||
),
|
),
|
||||||
pytest.param(
|
|
||||||
None,
|
|
||||||
('we consider None equivalent to missing personalisation'),
|
|
||||||
'',
|
|
||||||
marks=pytest.mark.xfail
|
|
||||||
),
|
|
||||||
])
|
])
|
||||||
def test_send_notification_with_placeholders_replaced_with_unusual_types(
|
def test_send_notification_with_placeholders_replaced_with_unusual_types(
|
||||||
client,
|
client,
|
||||||
@@ -209,6 +203,43 @@ def test_send_notification_with_placeholders_replaced_with_unusual_types(
|
|||||||
assert response_data['subject'] == expected_subject
|
assert response_data['subject'] == expected_subject
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('personalisation, expected_body, expected_subject', [
|
||||||
|
(
|
||||||
|
None,
|
||||||
|
('we consider None equivalent to missing personalisation'),
|
||||||
|
'',
|
||||||
|
),
|
||||||
|
])
|
||||||
|
def test_send_notification_with_placeholders_replaced_with_unusual_types_no_personalization(
|
||||||
|
client,
|
||||||
|
sample_email_template_with_placeholders,
|
||||||
|
mocker,
|
||||||
|
personalisation,
|
||||||
|
expected_body,
|
||||||
|
expected_subject,
|
||||||
|
):
|
||||||
|
mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
|
||||||
|
|
||||||
|
response = client.post(
|
||||||
|
path='/notifications/email',
|
||||||
|
data=json.dumps(
|
||||||
|
{
|
||||||
|
'to': 'ok@ok.com',
|
||||||
|
'template': str(sample_email_template_with_placeholders.id),
|
||||||
|
'personalisation': {
|
||||||
|
'name': personalisation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
headers=[
|
||||||
|
('Content-Type', 'application/json'),
|
||||||
|
create_service_authorization_header(service_id=sample_email_template_with_placeholders.service.id)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
assert response.status_code == 400
|
||||||
|
|
||||||
|
|
||||||
def test_should_not_send_notification_for_archived_template(notify_api, sample_template):
|
def test_should_not_send_notification_for_archived_template(notify_api, sample_template):
|
||||||
with notify_api.test_request_context():
|
with notify_api.test_request_context():
|
||||||
with notify_api.test_client() as client:
|
with notify_api.test_client() as client:
|
||||||
|
|||||||
Reference in New Issue
Block a user