Merge pull request #886 from alphagov/handle-new-template-stats-endpoint

For the brief moment when we have incompatible API versions out,
This commit is contained in:
minglis
2016-08-23 10:30:06 +01:00
committed by GitHub
2 changed files with 1 additions and 4 deletions
+1 -3
View File
@@ -186,9 +186,7 @@ def delete_service_template(service_id, template_id):
template['template_content'] = template['content'] template['template_content'] = template['content']
form = form_objects[template['template_type']](**template) form = form_objects[template['template_type']](**template)
template_statistics = template_statistics_client.get_template_statistics_for_template(service_id, template['id']) flash('Are you sure you want to delete it?', 'delete')
last_use_message = get_last_use_message(form.name.data, template_statistics)
flash('{}. Are you sure you want to delete it?'.format(last_use_message), 'delete')
return render_template( return render_template(
'views/edit-{}-template.html'.format(template['template_type']), 'views/edit-{}-template.html'.format(template['template_type']),
h1='Edit template', h1='Edit template',
-1
View File
@@ -249,7 +249,6 @@ def test_should_show_delete_template_page(app_,
assert 'Two week reminder' in content assert 'Two week reminder' in content
assert 'Your vehicle tax is about to expire' in content assert 'Your vehicle tax is about to expire' in content
mock_get_service_template.assert_called_with(service_id, template_id) mock_get_service_template.assert_called_with(service_id, template_id)
mock_get_template_statistics_for_template.assert_called_with(service_id, template_id)
def test_should_redirect_when_deleting_a_template(app_, def test_should_redirect_when_deleting_a_template(app_,