diff --git a/openerp/addons/base/tests/test_mail.py b/openerp/addons/base/tests/test_mail.py index ec9877f895d..8186674b964 100644 --- a/openerp/addons/base/tests/test_mail.py +++ b/openerp/addons/base/tests/test_mail.py @@ -330,6 +330,13 @@ class TestCleaner(unittest.TestCase): for ext in test_mail_examples.BUG_3_OUT: self.assertNotIn(ext, new_html, 'html_email_cleaner did not removed invalid content') + def test_80_remove_classes(self): + new_html = html_email_clean(test_mail_examples.REMOVE_CLASS, remove=True) + for ext in test_mail_examples.REMOVE_CLASS_IN: + self.assertIn(ext, new_html, 'html_email_cleaner wrongly removed classes') + for ext in test_mail_examples.REMOVE_CLASS_OUT: + self.assertNotIn(ext, new_html, 'html_email_cleaner did not removed correctly unwanted classes') + def test_90_misc(self): # False boolean for text must return empty string new_html = html_email_clean(False) diff --git a/openerp/addons/base/tests/test_mail_examples.py b/openerp/addons/base/tests/test_mail_examples.py index 97a34c45e55..3342876bf73 100644 --- a/openerp/addons/base/tests/test_mail_examples.py +++ b/openerp/addons/base/tests/test_mail_examples.py @@ -91,12 +91,12 @@ OERP_WEBSITE_HTML_1 = """ OERP_WEBSITE_HTML_1_IN = [ 'Manage your company most important asset: People', - 'img class="img-rounded img-responsive" src="/website/static/src/img/china_thumb.jpg"', + 'src="/website/static/src/img/china_thumb.jpg"', ] OERP_WEBSITE_HTML_1_OUT = [ 'Break down information silos.', 'Keep track of the vacation days accrued by each employee', - 'img class="img-rounded img-responsive" src="/website/static/src/img/deers_thumb.jpg', + 'src="/website/static/src/img/deers_thumb.jpg', ] OERP_WEBSITE_HTML_2 = """ @@ -205,7 +205,7 @@ OERP_WEBSITE_HTML_2_IN = [ ] OERP_WEBSITE_HTML_2_OUT = [ 'Make every employee feel more connected', - 'img class="img-responsive shadow" src="/website/static/src/img/text_image.png', + 'src="/website/static/src/img/text_image.png', ] TEXT_1 = """I contact you about our meeting tomorrow. Here is the schedule I propose: @@ -1173,3 +1173,34 @@ BUG_3_IN = [ BUG_3_OUT = [ 'New kanban view of documents' ] + +REMOVE_CLASS = """ +
+
Hello
+
I have just installed Odoo 9 and I've got the following error:
+
 
+
+ +
+ + +
+""" + +REMOVE_CLASS_IN = [ + 'An error occured in a modal and I will send you back the html to try opening one on your end' +] +REMOVE_CLASS_OUT = [ + '