diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-16 13:13:03 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-16 13:13:03 -0500 |
commit | 96998dd9fbf060cb873176440b75c51238e1c4ba (patch) | |
tree | a6e3e821f60f284592fd82b2451526ae1f2045d3 /test/test_exceptions.py | |
parent | 0050ca812536b4dce06d3e4a811e451676c0e60a (diff) | |
download | external_python_mako-96998dd9fbf060cb873176440b75c51238e1c4ba.tar.gz external_python_mako-96998dd9fbf060cb873176440b75c51238e1c4ba.tar.bz2 external_python_mako-96998dd9fbf060cb873176440b75c51238e1c4ba.zip |
- [bug] The exception message in the html_error_template
is now escaped with the HTML filter. [ticket:142]
Diffstat (limited to 'test/test_exceptions.py')
-rw-r--r-- | test/test_exceptions.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/test_exceptions.py b/test/test_exceptions.py index 1ddca4f..70fe39f 100644 --- a/test/test_exceptions.py +++ b/test/test_exceptions.py @@ -20,8 +20,8 @@ class ExceptionsTest(TemplateTest): assert False except exceptions.CompileException, ce: html_error = exceptions.html_error_template().render_unicode() - assert ("CompileException: Fragment 'i = 0' is not a partial " - "control statement") in html_error + assert ("CompileException: Fragment 'i = 0' is not " + "a partial control statement at line: 2 char: 1") in html_error assert '<style>' in html_error html_error_stripped = html_error.strip() assert html_error_stripped.startswith('<html>') @@ -75,10 +75,10 @@ ${u'привет'} template.render_unicode() except exceptions.CompileException, ce: html_error = exceptions.html_error_template().render() - assert ("CompileException: Fragment 'if 2 == 2: /an " - "error' is not a partial control " - "statement at line: 2 char: 1") in \ - html_error.decode('utf-8') + assert ("CompileException: Fragment 'if 2 == 2: /an " + "error' is not a partial control statement " + "at line: 2 char: 1") in \ + html_error if util.py3k: assert u"3 ${'привет'}".encode(sys.getdefaultencoding(), @@ -185,5 +185,4 @@ ${foobar} # and don't even send what we have. html_error = exceptions.html_error_template().\ render_unicode(error=v, traceback=None) - - assert "local variable 'y' referenced" in html_error + assert "local variable 'y' referenced before assignment" in html_error |