[Erp5-report] r27627 - /erp5/trunk/products/ERP5/tests/testBPMCore.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 17 11:14:05 CEST 2009


Author: luke
Date: Wed Jun 17 11:14:03 2009
New Revision: 27627

URL: http://svn.erp5.org?rev=27627&view=rev
Log:
 - use list accessors to check filtering
 - add source_section to have need for filtering

Modified:
    erp5/trunk/products/ERP5/tests/testBPMCore.py

Modified: erp5/trunk/products/ERP5/tests/testBPMCore.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testBPMCore.py?rev=27627&r1=27626&r2=27627&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBPMCore.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testBPMCore.py [utf8] Wed Jun 17 11:14:03 2009
@@ -2372,13 +2372,16 @@
     )
 
   def test_BusinessPathStandardCategoryAccessProvider(self):
-    node = self.portal.organisation_module.newContent(
+    source_node = self.portal.organisation_module.newContent(
+                    portal_type='Organisation')
+    source_section_node = self.portal.organisation_module.newContent(
                     portal_type='Organisation')
     business_path = self.createBusinessPath()
-    business_path.setSourceValue(node)
-    self.assertEquals(node, business_path.getSourceValue())
-    self.assertEquals(node.getRelativeUrl(), business_path.getSource())
-    self.assertEquals(node.getRelativeUrl(),
+    business_path.setSourceValue(source_node)
+    business_path.setSourceSectionValue(source_section_node)
+    self.assertEquals([source_node], business_path.getSourceValueList())
+    self.assertEquals([source_node.getRelativeUrl()], business_path.getSourceList())
+    self.assertEquals(source_node.getRelativeUrl(),
         business_path.getSource(default='something'))
 
   def test_EmptyBusinessPathStandardCategoryAccessProvider(self):
@@ -2389,18 +2392,21 @@
         business_path.getSource(default='something'))
 
   def test_BuinessPathDynamicCategoryAccessProvider(self):
-    node = self.portal.organisation_module.newContent(
+    source_node = self.portal.organisation_module.newContent(
+                    portal_type='Organisation')
+    source_section_node = self.portal.organisation_module.newContent(
                     portal_type='Organisation')
     business_path = self.createBusinessPath()
     business_path.setSourceMethodId('BusinessPath_getDefaultSourceList')
 
     context_movement = self.createMovement()
-    context_movement.setSourceValue(node)
+    context_movement.setSourceValue(source_node)
+    context_movement.setSourceSectionValue(source_section_node)
     self.assertEquals(None, business_path.getSourceValue())
-    self.assertEquals(node,
-                      business_path.getSourceValue(context=context_movement))
-    self.assertEquals(node.getRelativeUrl(),
-                      business_path.getSource(context=context_movement))
+    self.assertEquals([source_node],
+                      business_path.getSourceValueList(context=context_movement))
+    self.assertEquals([source_node.getRelativeUrl()],
+                      business_path.getSourceList(context=context_movement))
     self.assertEquals(node.getRelativeUrl(),
       business_path.getSource(context=context_movement, default='something'))
 




More information about the Erp5-report mailing list