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

Follow buildability.

As lazy causality is added to buildable movements, differentiate assertion.
parent c2a61d30
...@@ -433,8 +433,18 @@ class TestTradeModelLine(TestTradeModelLineMixin): ...@@ -433,8 +433,18 @@ class TestTradeModelLine(TestTradeModelLineMixin):
total_price = expected_result_dict[use].get(line.getId()) or 0.0 total_price = expected_result_dict[use].get(line.getId()) or 0.0
if True: if True:
sm = result_dict.pop(use) sm = result_dict.pop(use)
business_link_list = sm.asComposedDocument().getBusinessLinkValueList(context=sm)
self.assertEqual(len(business_link_list), 1)
is_buildable = sm.isBuildable(business_link_list[0])
self.assertEqual(str(sm.getTotalPrice() or 0.0), str(total_price)) self.assertEqual(str(sm.getTotalPrice() or 0.0), str(total_price))
if is_buildable:
self.assertEqual(3, len(sm.getCausalityValueList()))
else:
self.assertEqual(2, len(sm.getCausalityValueList())) self.assertEqual(2, len(sm.getCausalityValueList()))
if is_buildable:
self.assertEqual(1, len(sm.getCausalityValueList(
portal_type=self.business_link_portal_type)))
else:
self.assertEqual(0, len(sm.getCausalityValueList( self.assertEqual(0, len(sm.getCausalityValueList(
portal_type=self.business_link_portal_type))) portal_type=self.business_link_portal_type)))
self.assertEqual(1, len(sm.getCausalityValueList( self.assertEqual(1, len(sm.getCausalityValueList(
......
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