Refactored get template test

This commit is contained in:
Ken Tsang
2017-03-17 13:32:06 +00:00
parent fad67e1bdd
commit 8d63f8d9d3

View File

@@ -4,15 +4,14 @@ import uuid
from flask import json
from app import DATETIME_FORMAT
from app.models import EMAIL_TYPE, SMS_TYPE, LETTER_TYPE
from app.models import EMAIL_TYPE, SMS_TYPE, LETTER_TYPE, TEMPLATE_TYPES
from tests import create_authorization_header
from tests.app.db import create_template
template_types = [EMAIL_TYPE, SMS_TYPE, LETTER_TYPE]
valid_version_params = [None, 1]
@pytest.mark.parametrize("tmp_type", template_types)
@pytest.mark.parametrize("tmp_type", TEMPLATE_TYPES)
@pytest.mark.parametrize("version", valid_version_params)
def test_get_email_template_by_id_returns_200(client, sample_service, tmp_type, version):
template = create_template(sample_service, template_type=tmp_type)
@@ -66,7 +65,7 @@ def test_get_template_with_non_existent_template_id_returns_404(client, sample_s
}
@pytest.mark.parametrize("tmp_type", template_types)
@pytest.mark.parametrize("tmp_type", TEMPLATE_TYPES)
def test_get_template_with_non_existent_version_returns_404(client, sample_service, tmp_type):
template = create_template(sample_service, template_type=tmp_type)