Skip to content

Commit

Permalink
Fix autocolls tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Oct 17, 2022
1 parent 096210b commit 64a000a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pywb/apps/rewriterapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ def __init__(self, framed_replay=False, jinja_env=None, config=None, paths=None)
self.redirect_to_exact = config.get('redirect_to_exact')

self.banner_view = BaseInsertView(self.jinja_env, self._html_templ('banner_html'))
self.custom_banner_view = BaseInsertView(self.jinja_env, self._html_templ('custom_banner_html'))

self.head_insert_view = HeadInsertView(self.jinja_env,
self._html_templ('head_insert_html'),
self.banner_view)
self.custom_banner_view)

self.frame_insert_view = TopFrameView(self.jinja_env,
self._html_templ('frame_insert_html'),
Expand Down
2 changes: 1 addition & 1 deletion pywb/rewrite/templateview.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def make_head_insert(rule, cdx):

if self.banner_view:
banner_html = self.banner_view.render_to_string(env, cdx=cdx, **params)
params['banner_html'] = banner_html
params['custom_banner_html'] = banner_html

return self.render_to_string(env, cdx=cdx, **params)

Expand Down
2 changes: 1 addition & 1 deletion pywb/templates/head_insert.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

{% if not is_framed %}

{% include 'custom_banner.html' %}
{{ custom_banner_html }}

{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_auto_colls.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_custom_template_search(self):
assert 'pywb custom search page' in resp.text

def test_add_custom_banner(self):
""" Test adding custom banner.html per-collection template
""" Test adding custom_banner.html per-collection template
"""

banner_file = os.path.join(self.root_dir, COLLECTIONS, 'test',
Expand Down

0 comments on commit 64a000a

Please sign in to comment.