Commit 248bd1bb authored by Aurel's avatar Aurel

add a test with prooves that findSpecialiseValueList does not work if

we provide portal_type_list parameter and an at least 3 level
inheritance tree


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31246 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ab52f256
...@@ -1441,7 +1441,7 @@ class TestTradeModelLine(TestTradeModelLineMixin): ...@@ -1441,7 +1441,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
According to Depth-first search algorithm, result of this graph is: According to Depth-first search algorithm, result of this graph is:
[trade_condition_1, trade_condition_2, trade_condition_3, [trade_condition_1, trade_condition_2, trade_condition_3,
trade_condition_4, trade_condition_5] trade_condition_4]
''' '''
trade_condition_1 = self.createTradeCondition() trade_condition_1 = self.createTradeCondition()
trade_condition_2 = self.createTradeCondition() trade_condition_2 = self.createTradeCondition()
...@@ -1459,6 +1459,46 @@ class TestTradeModelLine(TestTradeModelLineMixin): ...@@ -1459,6 +1459,46 @@ class TestTradeModelLine(TestTradeModelLineMixin):
[trade_condition_1, trade_condition_2, trade_condition_3, [trade_condition_1, trade_condition_2, trade_condition_3,
trade_condition_4], specialise_value_list) trade_condition_4], specialise_value_list)
def test_findSpecialiseValueListWithPortalType(self):
'''
check that findSpecialiseValueList is able to return all the inheritance
model tree using Depth-first search with a specific portal_type asked
trade_condition_1
/ \
/ \
/ \
trade_condition_2 trade_condition_3
|
|
|
trade_condition_4
|
|
|
business_process
As only business_process will be a "Business Process" and we search for business process
the result must be [business_process]
'''
trade_condition_1 = self.createTradeCondition()
trade_condition_2 = self.createTradeCondition()
trade_condition_3 = self.createTradeCondition()
trade_condition_4 = self.createTradeCondition()
business_process = self.createBusinessProcess()
trade_condition_1.setSpecialiseValueList((trade_condition_2,
trade_condition_3))
trade_condition_2.setSpecialiseValue(trade_condition_4)
trade_condition_4.setSpecialiseValue(business_process)
specialise_value_list = trade_condition_1.findSpecialiseValueList(
portal_type_list = ['Business Process'],
context=trade_condition_1)
self.assertEquals(len(specialise_value_list), 1)
self.assertEquals([business_process,] , specialise_value_list)
def test_TradeConditionTradeModelLineReferenceIsShadowingComposition(self): def test_TradeConditionTradeModelLineReferenceIsShadowingComposition(self):
trade_condition_1 = self.createTradeCondition() trade_condition_1 = self.createTradeCondition()
trade_condition_2 = self.createTradeCondition() trade_condition_2 = self.createTradeCondition()
......
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