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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 11 17:04:15 CET 2010


Author: nicolas
Date: Mon Jan 11 17:04:12 2010
New Revision: 31685

URL: http://svn.erp5.org?rev=31685&view=rev
Log:
* pdf size is not predictable according OOo version installed on server
reviewed by romain

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=31685&r1=31684&r2=31685&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Mon Jan 11 17:04:12 2010
@@ -1020,11 +1020,11 @@
     '''Check that once the document is converted and cached, its size is
     correctly set'''
     portal = self.getPortalObject()
-    document_module = portal.getDefaultModule('Presentation')
-    pdf_size = 27131 # octets
+    portal_type = 'Text'
+    document_module = portal.getDefaultModule(portal_type)
 
     # create a text document in document module
-    text_document = document_module.newContent(portal_type='Text',
+    text_document = document_module.newContent(portal_type=portal_type,
                                                reference='Foo_001',
                                                title='Foo_OO1')
     f = makeFileUpload('Foo_001.odt')
@@ -1040,7 +1040,8 @@
     self.assertFalse(text_document.hasConversion(format='pdf'))
 
     # call pdf conversion, in this way, the result should be cached
-    text_document.convert(format='pdf')
+    mime_type, pdf_data = text_document.convert(format='pdf')
+    pdf_size = len(pdf_data)
 
 
     # check there is a cache entry for pdf conversion of this document




More information about the Erp5-report mailing list