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

- use list accessors to check filtering

 - add source_section to have need for filtering


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27627 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 606a1fed
......@@ -2372,13 +2372,16 @@ class TestBPMImplementation(TestBPMMixin):
)
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 @@ class TestBPMImplementation(TestBPMMixin):
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'))
......
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