'test that htmlentityreplace formatting is applied to
exceptions reported with format_exceptions=True'

@requires_no_pygments_exceptions
def test_utf8_format_exceptions_no_pygments(self):

    l = TemplateLookup(format_exceptions=True)
    if compat.py3k:
        l.put_string('foo.html', "#    -*-    coding:    utf-8    -*-\n${'\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82'    +    foobar}")
    else:
        l.put_string('foo.html', "#    -*-    coding:    utf-8    -*-\n${u'\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82'    +    foobar}")
    if compat.py3k:
        assert ('<div    class="sourceline">${&#39;\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82&#39;    +    foobar}</div>' in result_lines(l.get_template('foo.html').render().decode('utf-8')))
    else:
        assert ('${u&#39;&#x43F;&#x440;&#x438;&#x432;&#x435;&#x442;&#39;    +    foobar}' in result_lines(l.get_template('foo.html').render().decode('utf-8')))
