'Test check_underscore_file_is_safe with unsafe template'

def test_check_underscore_file_is_not_safe(self):

    linter = UnderscoreTemplateLinter()
    results = FileResults('')
    template = textwrap.dedent("\n                                                <%=    gettext('Single    Line')    %>\n\n                                                <%=\n                                                                gettext('Multiple    Lines')\n                                                %>\n                                ")
    linter.check_underscore_file_is_safe(template, results)
    self.assertEqual(len(results.violations), 2)
    self.assertEqual(results.violations[0].rule, Rules.underscore_not_escaped)
    self.assertEqual(results.violations[1].rule, Rules.underscore_not_escaped)
