# -*- coding: utf-8 -*- import sys import unittest from mako import exceptions, util from mako.template import Template from mako.lookup import TemplateLookup from util import result_lines from test import template_base, module_base, TemplateTest 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, ce: html_error = exceptions.html_error_template().render_unicode() assert ("CompileException: Fragment 'i = 0' is not a partial " "control statement") in html_error assert '