Test can create letters template

It works already, just making sure it stays working.
This commit is contained in:
Chris Hill-Scott
2016-11-07 15:38:04 +00:00
parent f34b58e7cd
commit 73fe331dc8
2 changed files with 5 additions and 2 deletions

View File

@@ -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 = {

View File

@@ -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)