diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 38d175a92..6c9817115 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -92,6 +92,7 @@ def delete_service_template(service_id, template_id): else: raise e + template['template_content'] = template['content'] form = TemplateForm(**template) if request.method == 'POST': diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index fb2548a65..47af74f9f 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -95,8 +95,11 @@ def test_should_show_delete_template_page(app_, service_id=service_id, template_id=template_id)) + content = response.get_data(as_text=True) assert response.status_code == 200 - assert 'Are you sure' in response.get_data(as_text=True) + assert 'Are you sure' in content + assert 'Two week reminder' in content + assert 'Your vehicle tax is about to expire' in content mock_get_service_template.assert_called_with( service_id, template_id)