From 46a741083974af895f72d30577c97c20e956dd96 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Sun, 24 Jan 2016 13:27:43 +0000 Subject: [PATCH] Add test for template page repopulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bug was found whereby the body of a template was not being shown in the on the page when returning to edit an existing template. This bug was caused by renaming the field in some places, but not in the `Form` class. This bug has since been fixed, but this commit adds a test to make sure that it doesn’t happen again. --- tests/app/main/views/test_templates.py | 2 ++ tests/conftest.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index cdf7284cf..662714951 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -38,6 +38,8 @@ def test_should_show_page_for_one_templates(app_, template_id=template_id)) assert response.status_code == 200 + assert "Two week reminder" in response.get_data(as_text=True) + assert "Your vehicle tax is about to expire" in response.get_data(as_text=True) mock_get_service_template.assert_called_with( service_id, template_id) diff --git a/tests/conftest.py b/tests/conftest.py index f4c743cac..4721fee81 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -160,7 +160,7 @@ def mock_delete_service(mocker, mock_get_service): def mock_get_service_template(mocker): def _create(service_id, template_id): template = template_json( - template_id, "Template Name", "sms", "template content", service_id) + template_id, "Two week reminder", "sms", "Your vehicle tax is about to expire", service_id) return {'data': template} return mocker.patch(