[Erp5-report] r35965 luke - /erp5/trunk/products/ERP5OOo/tests/testDms.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jun 3 17:10:13 CEST 2010


Author: luke
Date: Thu Jun  3 17:10:10 2010
New Revision: 35965

URL: http://svn.erp5.org?rev=35965&view=rev
Log:
 - add PDF_checkConversionFormatPermission script overwrite, to really test Document.PDFDocument

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=35965&r1=35964&r2=35965&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Thu Jun  3 17:10:10 2010
@@ -167,12 +167,15 @@
       assert not activity_status
     self.clearDocumentModule()
 
+  conversion_format_permission_script_id_list = [
+      'Document_checkConversionFormatPermission',
+      'PDF_checkConversionFormatPermission']
   def clearRestrictedSecurityHelperScript(self):
-    script_id = 'Document_checkConversionFormatPermission'
-    custom = self.getPortal().portal_skins.custom
-    if script_id in custom.objectIds():
-      custom.manage_delObjects(ids=[script_id])
-      transaction.commit()
+    for script_id in self.conversion_format_permission_script_id_list:
+      custom = self.getPortal().portal_skins.custom
+      if script_id in custom.objectIds():
+        custom.manage_delObjects(ids=[script_id])
+        transaction.commit()
 
   def clearDocumentModule(self):
     """
@@ -1727,13 +1730,15 @@
     self.assertRaises(Unauthorized, document.asText)
 
   def createRestrictedSecurityHelperScript(self):
-    createZODBPythonScript(self.getPortal().portal_skins.custom,
-    'Document_checkConversionFormatPermission', 'format=None, **kw', """
+    script_content_list = ['format=None, **kw', """
 if not format:
   return 0
 return 1
-""")
-    transaction.commit()
+"""]
+    for script_id in self.conversion_format_permission_script_id_list:
+      createZODBPythonScript(self.getPortal().portal_skins.custom,
+      script_id, *script_content_list)
+      transaction.commit()
 
   def _test_document_conversion_to_base_format_no_original_format_access(self,
       portal_type, file_name):




More information about the Erp5-report mailing list