Commit cc0893c5 authored by Łukasz Nowak's avatar Łukasz Nowak

- add PDF_checkConversionFormatPermission script overwrite, to really test Document.PDFDocument


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35965 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89997d21
...@@ -167,12 +167,15 @@ class TestDocumentMixin(ERP5TypeTestCase): ...@@ -167,12 +167,15 @@ class TestDocumentMixin(ERP5TypeTestCase):
assert not activity_status assert not activity_status
self.clearDocumentModule() self.clearDocumentModule()
conversion_format_permission_script_id_list = [
'Document_checkConversionFormatPermission',
'PDF_checkConversionFormatPermission']
def clearRestrictedSecurityHelperScript(self): def clearRestrictedSecurityHelperScript(self):
script_id = 'Document_checkConversionFormatPermission' for script_id in self.conversion_format_permission_script_id_list:
custom = self.getPortal().portal_skins.custom custom = self.getPortal().portal_skins.custom
if script_id in custom.objectIds(): if script_id in custom.objectIds():
custom.manage_delObjects(ids=[script_id]) custom.manage_delObjects(ids=[script_id])
transaction.commit() transaction.commit()
def clearDocumentModule(self): def clearDocumentModule(self):
""" """
...@@ -1727,13 +1730,15 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p> ...@@ -1727,13 +1730,15 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
self.assertRaises(Unauthorized, document.asText) self.assertRaises(Unauthorized, document.asText)
def createRestrictedSecurityHelperScript(self): def createRestrictedSecurityHelperScript(self):
createZODBPythonScript(self.getPortal().portal_skins.custom, script_content_list = ['format=None, **kw', """
'Document_checkConversionFormatPermission', 'format=None, **kw', """
if not format: if not format:
return 0 return 0
return 1 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, def _test_document_conversion_to_base_format_no_original_format_access(self,
portal_type, file_name): portal_type, file_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment