Restore dao_create_template and use custom template fixture instead

This commit is contained in:
Imdad Ahad
2017-03-08 13:03:44 +00:00
parent 36d52c6e42
commit a4dc614ef7
4 changed files with 50 additions and 43 deletions

View File

@@ -26,11 +26,11 @@ from app.dao.provider_details_dao import (
)
from app.models import Service, Template
from app.utils import get_london_midnight_in_utc
from tests.app.db import create_notification, create_service, create_template
from tests.app.db import create_notification, create_service
from tests.app.conftest import (
sample_job as create_sample_job,
sample_notification_history as create_notification_history,
create_notify_template
create_custom_template
)
from tests.conftest import set_config_values
from unittest.mock import call, patch, PropertyMock
@@ -46,17 +46,12 @@ def _create_slow_delivery_notification(provider='mmg'):
)
template = Template.query.get(current_app.config['FUNCTIONAL_TEST_PROVIDER_SMS_TEMPLATE_ID'])
if not template:
template = create_notify_template(
template = create_custom_template(
service=service,
user=service.users[0],
template_config_name='FUNCTIONAL_TEST_PROVIDER_SMS_TEMPLATE_ID',
content='',
template_type='sms'
)
# template = create_template(
# template_id=current_app.config.get('FUNCTIONAL_TEST_PROVIDER_SMS_TEMPLATE_ID'),
# service=service
# )
create_notification(
template=template,