From 542f097b6d738e76fb943fca67ca7296c455f593 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 2 Mar 2016 13:17:24 +0000 Subject: [PATCH] Make the template preview work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The template was displaying raw, eg ‘Hello ((name))’ This commit changes it to use the `.formatted_as_markup` property so the template is rendered with: - the placeholders as blue lozenges - the service name prefixing the message --- app/templates/views/job.html | 2 +- tests/app/main/views/test_jobs.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/templates/views/job.html b/app/templates/views/job.html index 416da439e..b10e5d89f 100644 --- a/app/templates/views/job.html +++ b/app/templates/views/job.html @@ -19,7 +19,7 @@
{{ sms_message( - template, + template.formatted_as_markup, )}}
diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index c3147555f..6e5574061 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -41,4 +41,6 @@ def test_should_show_page_for_one_job(app_, response = client.get(url_for('main.view_job', service_id=service_id, job_id=job_id)) assert response.status_code == 200 - assert file_name in response.get_data(as_text=True) + content = response.get_data(as_text=True) + assert "Test Service: Your vehicle tax is about to expire" in content + assert file_name in content