[IMP] tools mail: encoding : add test for removing encoding attribute

bzr revid: chm@openerp.com-20121219143912-os160iv0q0jeyhld
This commit is contained in:
Christophe Matthieu 2012-12-19 15:39:12 +01:00
parent 111e080e48
commit bf11573436
1 changed files with 2 additions and 1 deletions

View File

@ -178,7 +178,8 @@ class TestCleaner(unittest2.TestCase):
self.assertEqual(new_html, False, 'html_email_cleaner did change a False in an other value.')
# Test6: Message with xml and doctype tags don't crash
html_email_clean(u'<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n <title>404 - Not Found</title>\n </head>\n <body>\n <h1>404 - Not Found</h1>\n </body>\n</html>\n')
new_html = html_email_clean(u'<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n <title>404 - Not Found</title>\n </head>\n <body>\n <h1>404 - Not Found</h1>\n </body>\n</html>\n')
self.assertNotIn('encoding', new_html, 'html_email_cleaner did not remove correctly encoding attributes')
class TestHtmlTools(unittest2.TestCase):
""" Test some of our generic utility functions about html """