mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -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', [
|
@pytest.mark.parametrize('template_type, subject', [
|
||||||
('sms', None),
|
('sms', None),
|
||||||
('email', 'subject'),
|
('email', 'subject'),
|
||||||
|
('letter', 'subject'),
|
||||||
])
|
])
|
||||||
def test_create_template(sample_service, sample_user, template_type, subject):
|
def test_create_template(sample_service, sample_user, template_type, subject):
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ from app.dao.templates_dao import dao_get_template_by_id
|
|||||||
@pytest.mark.parametrize('template_type, subject', [
|
@pytest.mark.parametrize('template_type, subject', [
|
||||||
('sms', None),
|
('sms', None),
|
||||||
('email', 'subject'),
|
('email', 'subject'),
|
||||||
|
('letter', 'subject'),
|
||||||
])
|
])
|
||||||
def test_should_create_a_new_template_for_a_service(
|
def test_should_create_a_new_template_for_a_service(
|
||||||
notify_api, sample_user, sample_service, template_type, subject
|
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'
|
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_request_context():
|
||||||
with notify_api.test_client() as client:
|
with notify_api.test_client() as client:
|
||||||
data = {
|
data = {
|
||||||
'name': 'my template',
|
'name': 'my template',
|
||||||
'template_type': 'email',
|
'template_type': template_type,
|
||||||
'content': 'template content',
|
'content': 'template content',
|
||||||
'service': str(sample_service.id),
|
'service': str(sample_service.id),
|
||||||
'created_by': str(sample_user.id)
|
'created_by': str(sample_user.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user