def test_escaping(self):
        """Make sure we escape HTML entities, lest we court XSS errors."""
        class MockForm(object):
            errors = True
            auto_id = 'id_'

            def visible_fields(self):
                return [{'errors': ['<"evil&ness-field">']}]

            def non_field_errors(self):
                return ['<"evil&ness-non-field">']

        source = ("""{% from "layout/errorlist.html" import errorlist %}"""
                  """{{ errorlist(form) }}""")
        template = template_engines['backend'].from_string(source)
        html = template.render({'form': MockForm()})
        assert html not in '<"evil&ness'
        assert '&lt;&#34;evil&amp;ness-field&#34;&gt;' in html
        assert '&lt;&#34;evil&amp;ness-non-field&#34;&gt;' in html
dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/tests/test_templates.py/ErrorListTests.test_escaping/swapped operands of `not in`