[Erp5-report] r39652 nicolas.dumazet - /erp5/trunk/products/ERP5/tests/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 29 04:16:53 CEST 2010
Author: nicolas.dumazet
Date: Fri Oct 29 04:16:45 2010
New Revision: 39652
URL: http://svn.erp5.org?rev=39652&view=rev
Log:
fix test_security_defined_on_class after portal type classes changes
This test checks that wrapping a method in an interaction workflow adds
security to the wrapped method, but that it does not override existing
(class) security definition.
To do so, a private method (doSomethingStupid) is added on Organisation
document class. We really want to change the (static) document class here,
not the portal type class: before portal type classes changes,
ERP5Type.Document.Organisation.Organisation was a copy of the document
ERP5.Document.Organisation.Organisation. After portal classes, the former
is a portal type class, and it does not make sense in test logic to add
a method on the portal type class.
It is correct to change the import path to access the physical Document class.
Modified:
erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py
Modified: erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py?rev=39652&r1=39651&r2=39652&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py [utf8] Fri Oct 29 04:16:45 2010
@@ -55,7 +55,7 @@ class TestInteractionWorkflow(ERP5TypeTe
self.login()
def beforeTearDown(self):
- Organisation = Products.ERP5Type.Document.Organisation.Organisation
+ Organisation = Products.ERP5.Document.Organisation.Organisation
Organisation.security.names.pop('doSomethingStupid', None)
if hasattr(Organisation, 'doSomethingStupid'):
delattr(Organisation, 'doSomethingStupid')
@@ -73,7 +73,7 @@ class TestInteractionWorkflow(ERP5TypeTe
"""
"""
self.setDescription(value)
- Organisation = Products.ERP5Type.Document.Organisation.Organisation
+ Organisation = Products.ERP5.Document.Organisation.Organisation
Organisation.doSomethingStupid = doSomethingStupid
portal_type = self.getTypeTool()['Organisation']
portal_type._setTypeBaseCategoryList(['size'])
@@ -623,7 +623,7 @@ context.setTitle('Bar')
# wrapping a method in an interaction workflow adds a default security to
# this method, but does not override existing security definition (defined
# on the class)
- Organisation = Products.ERP5Type.Document.Organisation.Organisation
+ Organisation = Products.ERP5.Document.Organisation.Organisation
security = ClassSecurityInfo()
security.declarePrivate('doSomethingStupid')
security.apply(Organisation)
More information about the Erp5-report
mailing list