Commit 16925c5a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* rename rules and test methods.

* use 'delivery' matcher on the root rules.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33460 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7efe8abb
...@@ -80,13 +80,14 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -80,13 +80,14 @@ class TestBPMEvaluationMixin(TestBPMMixin):
if rule.getValidationState() == 'validated': if rule.getValidationState() == 'validated':
rule.invalidate() rule.invalidate()
transaction.commit() transaction.commit()
self._createOrderRule() self._createOrderRootSimulationRule()
self._createDeliveryRule() self._createDeliverySimulationRule()
self._createInvoicingRule() self._createDeliverySimulationRule()
self._createInvoiceRule() self._createInvoiceSimulationRule()
self._createTradeModelRule() self._createInvoiceRootSimulationRule()
self._createTradeModelSimulationRule()
def _createRootTradeRule(self, **kw):
def _createTradeRootSimulationRule(self, **kw):
edit_dict = {} edit_dict = {}
edit_dict.update( edit_dict.update(
trade_phase = 'default/delivery', trade_phase = 'default/delivery',
...@@ -95,19 +96,13 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -95,19 +96,13 @@ class TestBPMEvaluationMixin(TestBPMMixin):
rule = self.rule_tool.newContent(**edit_dict) rule = self.rule_tool.newContent(**edit_dict)
# matching providers # matching providers
for category in ('resource', 'order'): for category in ('delivery',):
rule.newContent( rule.newContent(
portal_type='Category Membership Divergence Tester', portal_type='Category Membership Divergence Tester',
title='%s divergence tester' % category, title='%s divergence tester' % category,
tested_property=category, tested_property=category,
divergence_provider=False, divergence_provider=False,
matching_provider=True) matching_provider=True)
rule.newContent(
portal_type='Variation Divergence Tester',
title='variation divergence tester',
tested_property='variation_property_dict',
divergence_provider=False,
matching_provider=True)
# divergence providers # divergence providers
for category in ('source_section', for category in ('source_section',
...@@ -146,22 +141,30 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -146,22 +141,30 @@ class TestBPMEvaluationMixin(TestBPMMixin):
return rule return rule
def _createOrderRule(self): def _createOrderRootSimulationRule(self):
rule = self._createRootTradeRule(portal_type='Order Root Simulation Rule', rule = self._createTradeRootSimulationRule(portal_type='Order Root Simulation Rule',
reference='default_order_rule') reference='default_order_rule')
rule.validate() rule.validate()
transaction.commit() transaction.commit()
def _createDeliveryRule(self): def _createDeliveryRootSimulationRule(self):
rule = self._createRootTradeRule(portal_type='Delivery Root Simulation Rule', rule = self._createTradeRootSimulationRule(portal_type='Delivery Root Simulation Rule',
reference='default_delivery_rule') reference='default_delivery_rule')
rule.validate() rule.validate()
transaction.commit() transaction.commit()
def _createTradeModelRule(self): def _createDeliverySimulationRule(self):
rule = self.rule_tool.newContent(portal_type='Delivery Simulation Rule',
reference='default_trade_model_rule',
test_method_id = ('SimulationMovement_testDeliverySimulationRule',)
)
rule.validate()
transaction.commit()
def _createTradeModelSimulationRule(self):
rule = self.rule_tool.newContent(portal_type='Trade Model Simulation Rule', rule = self.rule_tool.newContent(portal_type='Trade Model Simulation Rule',
reference='default_trade_model_rule', reference='default_trade_model_rule',
test_method_id = ('SimulationMovement_testTradeModelRule',) test_method_id = ('SimulationMovement_testTradeModelSimulationRule',)
) )
# matching providers # matching providers
for category in ('resource',): for category in ('resource',):
...@@ -226,7 +229,7 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -226,7 +229,7 @@ class TestBPMEvaluationMixin(TestBPMMixin):
rule.validate() rule.validate()
transaction.commit() transaction.commit()
def _createInvoiceRule(self): def _createInvoiceRootSimulationRule(self):
# Note: This is not used, but invoices, even if built from simulation, # Note: This is not used, but invoices, even if built from simulation,
# need those rule to create empty one applied rule # need those rule to create empty one applied rule
rule_tool = self.portal.portal_rules rule_tool = self.portal.portal_rules
...@@ -237,7 +240,7 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -237,7 +240,7 @@ class TestBPMEvaluationMixin(TestBPMMixin):
new_rule.validate() new_rule.validate()
transaction.commit() transaction.commit()
def _createInvoicingRule(self): def _createInvoiceSimulationRule(self):
edit_dict = {} edit_dict = {}
edit_dict.update( edit_dict.update(
) )
......
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