'Test _check_mako_file_is_safe with JavaScript error in JavaScript
context.'

def test_check_javascript_in_mako_javascript_context(self):

    linter = MakoTemplateLinter()
    results = FileResults('')
    mako_template = textwrap.dedent('\n                                                <%page    expression_filter="h"/>\n                                                <script    type="text/javascript">\n                                                                var    message    =    \'<p>\'    +    msg    +    \'</p>\';\n                                                </script>\n                                ')
    linter._check_mako_file_is_safe(mako_template, results)
    self.assertEqual(len(results.violations), 1)
    self.assertEqual(results.violations[0].rule, Rules.javascript_concat_html)
    self.assertEqual(results.violations[0].start_line, 4)
