Don’t show send/edit links for deleted template

Since you can’t really send or edit a deleted template we should show
a message telling you that the template has been deleted.

This is important because deleted templates still show up in the
template statistics.
This commit is contained in:
Chris Hill-Scott
2016-07-01 13:10:19 +01:00
parent 0d44fc770c
commit 02dccde0bd
4 changed files with 87 additions and 22 deletions

View File

@@ -245,6 +245,27 @@ def mock_get_service_template(mocker):
)
@pytest.fixture(scope='function')
def mock_get_deleted_template(mocker):
def _get(service_id, template_id, version=None):
template = template_json(
service_id,
template_id,
"Two week reminder",
"sms",
"Your vehicle tax is about to expire",
archived=True
)
if version:
template.update({'version': version})
return {'data': template}
return mocker.patch(
'app.service_api_client.get_service_template',
side_effect=_get
)
@pytest.fixture(scope='function')
def mock_get_template_version(mocker, fake_uuid, user=None):
if user is None: