mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Test can create letters template
It works already, just making sure it stays working.
This commit is contained in:
@@ -13,6 +13,7 @@ import pytest
|
||||
@pytest.mark.parametrize('template_type, subject', [
|
||||
('sms', None),
|
||||
('email', 'subject'),
|
||||
('letter', 'subject'),
|
||||
])
|
||||
def test_create_template(sample_service, sample_user, template_type, subject):
|
||||
data = {
|
||||
|
||||
@@ -12,6 +12,7 @@ from app.dao.templates_dao import dao_get_template_by_id
|
||||
@pytest.mark.parametrize('template_type, subject', [
|
||||
('sms', None),
|
||||
('email', 'subject'),
|
||||
('letter', 'subject'),
|
||||
])
|
||||
def test_should_create_a_new_template_for_a_service(
|
||||
notify_api, sample_user, sample_service, template_type, subject
|
||||
@@ -116,12 +117,13 @@ def test_should_be_error_if_service_does_not_exist_on_update(notify_api, fake_uu
|
||||
assert json_resp['message'] == 'No result found'
|
||||
|
||||
|
||||
def test_must_have_a_subject_on_an_email_template(notify_api, sample_user, sample_service):
|
||||
@pytest.mark.parametrize('template_type', ['email', 'letter'])
|
||||
def test_must_have_a_subject_on_an_email_or_letter_template(notify_api, sample_user, sample_service, template_type):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': 'my template',
|
||||
'template_type': 'email',
|
||||
'template_type': template_type,
|
||||
'content': 'template content',
|
||||
'service': str(sample_service.id),
|
||||
'created_by': str(sample_user.id)
|
||||
|
||||
Reference in New Issue
Block a user