Commit d6804d55 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: test: use valid trade condition to generate the simulation

parent 127ca24f
......@@ -159,11 +159,19 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
project = self.addProject()
person = self.makePerson(project, user=1)
sale_trade_condition = self.portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition",
reference=self.generateNewId(),
specialise="business_process_module/slapos_ultimate_business_process"
)
sale_trade_condition.validate()
template = self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate())
current_invoice = template.Base_createCloneDocument(batch_mode=1)
current_invoice.edit(
specialise_value=sale_trade_condition,
destination_value=person,
destination_section_value=person,
destination_decision_value=person,
......@@ -176,7 +184,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
cell = current_invoice["1"]["movement_0"]
cell.edit(quantity=1)
cell.setPrice(1)
current_invoice.plan()
current_invoice.confirm()
current_invoice.startBuilding()
......@@ -184,8 +192,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
current_invoice.stop()
self.tic()
current_invoice.Delivery_manageBuildingCalculatingDelivery()
self.tic()
applied_rule = current_invoice.getCausalityRelated(portal_type="Applied Rule")
for sm in self.portal.portal_catalog(portal_type='Simulation Movement',
simulation_state=['draft', 'planned', None],
......
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