# -*- coding: utf-8 -*- import sys from mako import exceptions, compat from mako.template import Template from mako.lookup import TemplateLookup from mako.compat import u from test.util import result_lines from test import TemplateTest from test import requires_pygments_14, requires_no_pygments_exceptions 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 '