Fix test for logging

This commit is contained in:
Fritz Reichwald 2016-12-28 22:35:03 +01:00
parent 421fc7eca3
commit 8c3d461482
2 changed files with 3 additions and 4 deletions

View File

@ -68,8 +68,8 @@ class Loader(jinja2.BaseLoader):
except OSError as e:
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
source = source.replace("%FILE%", html.escape(template))
log.misc.error("The {} template could not be found at {}".format(
template, path))
log.misc.exception("The {} template could not be loaded from {}"
.format(template, path))
# Currently we don't implement auto-reloading, so we always return True
# for up-to-date.
return source, path, lambda: True

View File

@ -111,9 +111,8 @@ def test_not_found(caplog):
data = jinja.render('does_not_exist.html')
assert "The does_not_exist.html template could not be found!" in data
assert len(caplog.records) == 1
assert caplog.records[0].msg.startswith("The does_not_exist.html template"
" could not be found at")
" could not be loaded from")
def test_utf8():