mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 15:56:45 -04:00
Refactored get template test
This commit is contained in:
@@ -4,15 +4,14 @@ import uuid
|
|||||||
from flask import json
|
from flask import json
|
||||||
|
|
||||||
from app import DATETIME_FORMAT
|
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 import create_authorization_header
|
||||||
from tests.app.db import create_template
|
from tests.app.db import create_template
|
||||||
|
|
||||||
template_types = [EMAIL_TYPE, SMS_TYPE, LETTER_TYPE]
|
|
||||||
valid_version_params = [None, 1]
|
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)
|
@pytest.mark.parametrize("version", valid_version_params)
|
||||||
def test_get_email_template_by_id_returns_200(client, sample_service, tmp_type, version):
|
def test_get_email_template_by_id_returns_200(client, sample_service, tmp_type, version):
|
||||||
template = create_template(sample_service, template_type=tmp_type)
|
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):
|
def test_get_template_with_non_existent_version_returns_404(client, sample_service, tmp_type):
|
||||||
template = create_template(sample_service, template_type=tmp_type)
|
template = create_template(sample_service, template_type=tmp_type)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user