mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add a ‘private’ preview email template endpoint
This will make working on the email template easier. Includes examples of features like lists, headings, blockquotes, etc.
This commit is contained in:
23
tests/app/main/views/test_email_preview.py
Normal file
23
tests/app/main/views/test_email_preview.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import pytest
|
||||
from flask import url_for
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query_args, params", [
|
||||
({}, {'govuk_banner': True}),
|
||||
({'govuk_banner': 'false'}, {'govuk_banner': False})
|
||||
]
|
||||
)
|
||||
def test_renders(app_, mocker, query_args, params):
|
||||
with app_.test_request_context(), app_.test_client() as client:
|
||||
|
||||
mock_html_email = mocker.patch(
|
||||
'app.main.views.index.HTMLEmail',
|
||||
return_value=lambda x: 'rendered'
|
||||
)
|
||||
|
||||
response = client.get(url_for('main.email_template', **query_args))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.get_data(as_text=True) == 'rendered'
|
||||
mock_html_email.assert_called_once_with(**params)
|
||||
Reference in New Issue
Block a user