Commit 8535452e authored by Łukasz Nowak's avatar Łukasz Nowak

Check children rule generation.

parent ac0b28fc
...@@ -123,6 +123,12 @@ class TestDefaultInvoicingRule(testSlapOSMixin): ...@@ -123,6 +123,12 @@ class TestDefaultInvoicingRule(testSlapOSMixin):
self.assertEqual(['business_process_module/slapos_sale_business_p' self.assertEqual(['business_process_module/slapos_sale_business_p'
'rocess/invoice_path', 'business_process_module/slapos_sale_b' 'rocess/invoice_path', 'business_process_module/slapos_sale_b'
'usiness_process/invoice'], simulation_movement.getCausalityList()) 'usiness_process/invoice'], simulation_movement.getCausalityList())
# check children rules' type
child_applied_rule_type_list = [q.getSpecialiseReference() for q in \
simulation_movement.contentValues(portal_type='Applied Rule')]
self.assertSameSet(
['default_invoice_transaction_rule', 'default_trade_model_rule'],
child_applied_rule_type_list)
finally: finally:
SimulationMovement.getSimulationState = SimulationMovement\ SimulationMovement.getSimulationState = SimulationMovement\
.original_getSimulationState .original_getSimulationState
...@@ -117,7 +117,7 @@ class TestHostingSubscriptionSimulation(testSlapOSMixin): ...@@ -117,7 +117,7 @@ class TestHostingSubscriptionSimulation(testSlapOSMixin):
applied_rule_list_level_2 = simulation_movement.contentValues( applied_rule_list_level_2 = simulation_movement.contentValues(
portal_type='Applied Rule') portal_type='Applied Rule')
self.assertEqual(0, len(applied_rule_list_level_2)) self.assertEqual(1, len(applied_rule_list_level_2))
# check next simulation movement # check next simulation movement
idx += 1 idx += 1
...@@ -216,9 +216,12 @@ class TestHostingSubscriptionSimulation(testSlapOSMixin): ...@@ -216,9 +216,12 @@ class TestHostingSubscriptionSimulation(testSlapOSMixin):
self.assertEqual('planned', simulation_movement.getSimulationState()) self.assertEqual('planned', simulation_movement.getSimulationState())
self.assertEqual(None, simulation_movement.getDelivery()) self.assertEqual(None, simulation_movement.getDelivery())
applied_rule_list_level_2 = simulation_movement.contentValues( # check children rules' type
portal_type='Applied Rule') child_applied_rule_type_list = [q.getSpecialiseReference() for q in \
self.assertEqual(0, len(applied_rule_list_level_2)) simulation_movement.contentValues(portal_type='Applied Rule')]
self.assertSameSet( ['default_invoicing_rule'],
child_applied_rule_type_list)
# check next simulation movement # check next simulation movement
idx += 1 idx += 1
def isFrozen(*args, **kwargs): def isFrozen(*args, **kwargs):
......
67 68
\ No newline at end of file \ No newline at end of file
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