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

Check children rule generation.

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