# -*- coding: utf-8 -*- import sys from mako import compat from mako import exceptions from mako.compat import u from mako.lookup import TemplateLookup from mako.template import Template from test import requires_no_pygments_exceptions from test import requires_pygments_14 from test import TemplateTest from test.util import result_lines class ExceptionsTest(TemplateTest): def test_html_error_template(self): """test the html_error_template""" code = """ % i = 0 """ try: template = Template(code) template.render_unicode() assert False except exceptions.CompileException: html_error = exceptions.html_error_template().render_unicode() assert ( "CompileException: Fragment 'i = 0' is not " "a partial control statement at line: 2 char: 1" ) in html_error assert "