[Erp5-report] r31629 nicolas - /erp5/trunk/products/ERP5OOo/tests/testDms.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 7 14:41:46 CET 2010


Author: nicolas
Date: Thu Jan  7 14:41:42 2010
New Revision: 31629

URL: http://svn.erp5.org?rev=31629&view=rev
Log:
Test bogus HTML conversion to PDF

Modified:
    erp5/trunk/products/ERP5OOo/tests/testDms.py

Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=31629&r1=31628&r2=31629&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Thu Jan  7 14:41:42 2010
@@ -894,6 +894,24 @@
     self.assertEquals('empty', document.getExternalProcessingState())
     self.assertEquals('File', document.getPortalType())
 
+  def test_HTML_to_ODT_conversion_keep_enconding(self):
+    """This test perform an PDF conversion of HTML content
+    then to plain text.
+    Check that encoding remains.
+    """
+    web_page_portal_type = 'Web Page'
+    string_to_test = 'éààéôù'
+    web_page = self.portal.getDefaultModule(web_page_portal_type)\
+          .newContent(portal_type=web_page_portal_type)
+    html_content = '<p>%s</p>' % string_to_test
+    web_page.edit(text_content=html_content)
+    mime_type, pdf_data = web_page.convert('pdf')
+    text_content = self.portal.portal_transforms.\
+                                      convertToData('text/plain',
+                                          str(pdf_data),
+                                          object=web_page, context=web_page,
+                                          filename='test.pdf')
+    self.assertTrue(string_to_test in text_content)
 
 
 class TestDocumentWithSecurity(ERP5TypeTestCase):




More information about the Erp5-report mailing list