misc: set response.content as bytes, as appropriate (#67137)
This commit is contained in:
parent
d097bd581a
commit
0b470987ba
|
@ -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)
|
||||
|
|
|
@ -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" %}<!DOCTYPE html>\n')
|
||||
|
||||
# url netloc match
|
||||
resp = app.get('/__skeleton__/?source=%s' % quote('http://example.net'))
|
||||
|
|
Loading…
Reference in New Issue