diff --git a/combo/public/views.py b/combo/public/views.py index 21fe3da7..a6984ec9 100644 --- a/combo/public/views.py +++ b/combo/public/views.py @@ -364,8 +364,8 @@ def skeleton(request): template_name = combo_template['template'] response = render(request, template_name, ctx) - response.content = '{%% with page_template_name="%s" %%}%s{%% endwith %%}' % ( - str(selected_page.template_name), + response.content = b'{%% with page_template_name="%s" %%}%s{%% endwith %%}' % ( + selected_page.template_name.encode(), response.content, ) response['X-Combo-Page-Id'] = str(selected_page.id) diff --git a/tests/test_public.py b/tests/test_public.py index cda84c85..e07a4d81 100644 --- a/tests/test_public.py +++ b/tests/test_public.py @@ -341,7 +341,7 @@ def test_page_skeleton(app): resp = app.get('/__skeleton__/?source=%s' % quote('http://example.net/foo/bar')) assert '{% block placeholder-content %}{% block content %}{% endblock %}{% endblock %}' in resp.text assert '{% block placeholder-footer %}{% block footer %}{% endblock %}{% endblock %}' in resp.text - assert resp.text.startswith('{% with page_template_name="standard" %}') + assert resp.text.startswith('{% with page_template_name="standard" %}\n') # url netloc match resp = app.get('/__skeleton__/?source=%s' % quote('http://example.net'))