Commit 420b3422 authored by Łukasz Nowak's avatar Łukasz Nowak

- add tests for default behaviour in case of empty category


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27625 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fe421e4f
...@@ -2381,6 +2381,13 @@ class TestBPMImplementation(TestBPMMixin): ...@@ -2381,6 +2381,13 @@ class TestBPMImplementation(TestBPMMixin):
self.assertEquals(node.getRelativeUrl(), self.assertEquals(node.getRelativeUrl(),
business_path.getSource(default='something')) business_path.getSource(default='something'))
def test_EmptyBusinessPathStandardCategoryAccessProvider(self):
business_path = self.createBusinessPath()
self.assertEquals(None, business_path.getSourceValue())
self.assertEquals(None, business_path.getSource())
self.assertEquals('something',
business_path.getSource(default='something'))
def test_BuinessPathDynamicCategoryAccessProvider(self): def test_BuinessPathDynamicCategoryAccessProvider(self):
node = self.portal.organisation_module.newContent( node = self.portal.organisation_module.newContent(
portal_type='Organisation') portal_type='Organisation')
...@@ -2397,6 +2404,19 @@ class TestBPMImplementation(TestBPMMixin): ...@@ -2397,6 +2404,19 @@ class TestBPMImplementation(TestBPMMixin):
self.assertEquals(node.getRelativeUrl(), self.assertEquals(node.getRelativeUrl(),
business_path.getSource(context=context_movement, default='something')) business_path.getSource(context=context_movement, default='something'))
def test_BuinessPathDynamicCategoryAccessProviderEmptyMovement(self):
business_path = self.createBusinessPath()
business_path.setSourceMethodId('BusinessPath_getDefaultSourceList')
context_movement = self.createMovement()
self.assertEquals(None, business_path.getSourceValue())
self.assertEquals(None,
business_path.getSourceValue(context=context_movement))
self.assertEquals(None,
business_path.getSource(context=context_movement))
self.assertEquals('something',
business_path.getSource(context=context_movement, default='something'))
def test_BusinessState_getRemainingTradePhaseList(self): def test_BusinessState_getRemainingTradePhaseList(self):
""" """
This test case is described for what trade_phase is remaining after the state. This test case is described for what trade_phase is remaining after the state.
......
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