Fix test for logging
This commit is contained in:
parent
421fc7eca3
commit
8c3d461482
@ -68,8 +68,8 @@ class Loader(jinja2.BaseLoader):
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
|
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
|
||||||
source = source.replace("%FILE%", html.escape(template))
|
source = source.replace("%FILE%", html.escape(template))
|
||||||
log.misc.error("The {} template could not be found at {}".format(
|
log.misc.exception("The {} template could not be loaded from {}"
|
||||||
template, path))
|
.format(template, path))
|
||||||
# Currently we don't implement auto-reloading, so we always return True
|
# Currently we don't implement auto-reloading, so we always return True
|
||||||
# for up-to-date.
|
# for up-to-date.
|
||||||
return source, path, lambda: True
|
return source, path, lambda: True
|
||||||
|
@ -111,9 +111,8 @@ def test_not_found(caplog):
|
|||||||
data = jinja.render('does_not_exist.html')
|
data = jinja.render('does_not_exist.html')
|
||||||
assert "The does_not_exist.html template could not be found!" in data
|
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"
|
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():
|
def test_utf8():
|
||||||
|
Loading…
Reference in New Issue
Block a user