'Test check_javascript_file_is_safe with concatenating strings and HTML'

@data({'template': 'var    m    =    "Plain    text    "    +    message    +    "plain    text"', 'rule': None}, {'template': 'var    m    =    "\xe6\xaa\x8c\xe6\xaa\x92\xe6\xbf\xa6    "    +    message    +    "plain    text"', 'rule': None}, {'template': '$email_header.append($(\'<input>\',    type:    "button",    name:    "copy-email-body-text",    value:    gettext("Copy    Email    To    Editor"),    id:    \'copy_email_\'    +    email_id))', 'rule': None}, {'template': 'var    m    =    "<p>"    +    message    +    "</p>"', 'rule': Rules.javascript_concat_html}, {'template': 'var    m    =    "<p>\\"escaped    quote\\""    +    message    +    "\\"escaped    quote\\"</p>"', 'rule': Rules.javascript_concat_html}, {'template': '        //    var    m    =    "<p>"    +    commentedOutMessage    +    "</p>"', 'rule': None}, {'template': 'var    m    =    "    <p>    "    +    message    +    "    </p>    "', 'rule': Rules.javascript_concat_html}, {'template': 'var    m    =    "    <p>    "    +    message    +    "    broken    string', 'rule': Rules.javascript_concat_html})
def test_concat_with_html(self, data):

    linter = JavaScriptLinter()
    results = FileResults('')
    linter.check_javascript_file_is_safe(data['template'], results)
    self._validate_data_rules(data, results)
