diff --git a/openerp/addons/base/tests/test_mail.py b/openerp/addons/base/tests/test_mail.py index 6b487c4e9a7..96e1973ed49 100644 --- a/openerp/addons/base/tests/test_mail.py +++ b/openerp/addons/base/tests/test_mail.py @@ -104,16 +104,15 @@ class TestSanitizer(unittest.TestCase): for email in emails: self.assertIn(cgi.escape(email), html_sanitize(email), 'html_sanitize stripped emails of original html') - def test_sanitize_escape_emails_cite(self): + def test_sanitize_unescape_emails(self): not_emails = [ - '
cat'] + '
cat', + '
]|a[^<>\s])[^<>]*)@[^<>]+>)", re.IGNORECASE | re.DOTALL) # remove results containing cite="mid:email_like@address" (ex: blockquote cite) # cite_except = re.compile(r"^((?!cite[\s]*=['\"]).)*$", re.IGNORECASE) - src = part.sub(lambda m: 'cite=' not in m.group(1) and cgi.escape(m.group(1)) or m.group(1), src) + src = part.sub(lambda m: ('cite=' not in m.group(1) and 'alt=' not in m.group(1)) and cgi.escape(m.group(1)) or m.group(1), src) # html encode mako tags <% ... %> to decode them later and keep them alive, otherwise they are stripped by the cleaner src = src.replace('<%', cgi.escape('<%')) src = src.replace('%>', cgi.escape('%>'))