Commit ba934fa9 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix several trivial mistakes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37647 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f10c0c01
...@@ -208,6 +208,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -208,6 +208,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
AcceptDecisionOfSalePackingLists AcceptDecisionOfSalePackingLists
MeasureAcceptanceOfDecisions MeasureAcceptanceOfDecisions
Tic Tic
UseRecipient1AsDestinationAdministration
CheckConvergedSalePackingLists CheckConvergedSalePackingLists
ConfirmSaleOrders ConfirmSaleOrders
Tic Tic
...@@ -319,12 +320,12 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -319,12 +320,12 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
sequence.set('measure_target', sequence.set('measure_target',
'Creation of New Applied Rules from Partially Simulated Deliveries') 'Creation of New Applied Rules from Partially Simulated Deliveries')
def stepCreationOfNewSaleInvoices(self, sequence=None, def stepMeasureCreationOfNewSaleInvoices(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
sequence.set('measure_target', 'Creation Of New Sale Invoices') sequence.set('measure_target', 'Creation Of New Sale Invoices')
def stepAdditionOfNewInvoiceLinesIntoSaleInvoices(self, sequence=None, def stepMeasureAdditionOfNewInvoiceLinesIntoSaleInvoices(self,
sequence_list=None, **kw): sequence=None, sequence_list=None, **kw):
sequence.set('measure_target', 'Addition of New Invoices Lines') sequence.set('measure_target', 'Addition of New Invoices Lines')
def stepUseClientAsDestinationDecision(self, sequence=None, def stepUseClientAsDestinationDecision(self, sequence=None,
...@@ -348,6 +349,11 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -348,6 +349,11 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
sequence.set('destination_administration', sequence.set('destination_administration',
'organisation_module/recipient1') 'organisation_module/recipient1')
def stepUseRecipient2AsDestinationAdministration(self, sequence=None,
sequence_list=None, **kw):
sequence.set('destination_administration',
'organisation_module/recipient2')
def stepUseResourceAsCommodityProduct(self, sequence=None, def stepUseResourceAsCommodityProduct(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
sequence.set('resource', 'product_module/commodity') sequence.set('resource', 'product_module/commodity')
...@@ -415,7 +421,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -415,7 +421,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
for order in module.contentValues(portal_type='Sale Order'): for order in module.contentValues(portal_type='Sale Order'):
self.assertEquals(order.getSimulationState(), 'ordered') self.assertEquals(order.getSimulationState(), 'ordered')
order.confirm() order.confirm()
self.assertEquals(order.getSimulationState(), 'confirm') self.assertEquals(order.getSimulationState(), 'confirmed')
def stepCheckSaleOrderSimulation(self, sequence=None, sequence_list=None, def stepCheckSaleOrderSimulation(self, sequence=None, sequence_list=None,
**kw): **kw):
...@@ -428,7 +434,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -428,7 +434,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
resource = sequence.get('resource') resource = sequence.get('resource')
self.assertEquals(module.objectCount(), number_of_sale_orders) self.assertEquals(module.objectCount(), number_of_sale_orders)
for order in module.contentValues(portal_type='Sale Order'): for order in module.contentValues(portal_type='Sale Order'):
causality_list = order.getCausalityRelatedValueList() causality_list = order.getCausalityRelatedValueList(portal_type='Applied Rule')
self.assertEquals(len(causality_list), 1) self.assertEquals(len(causality_list), 1)
applied_rule = causality_list[0] applied_rule = causality_list[0]
self.assertEquals(applied_rule.getPortalType(), 'Applied Rule') self.assertEquals(applied_rule.getPortalType(), 'Applied Rule')
...@@ -512,14 +518,15 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -512,14 +518,15 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
self.assertEquals(simulation_movement.getPortalType(), self.assertEquals(simulation_movement.getPortalType(),
'Simulation Movement') 'Simulation Movement')
self.assertEquals(simulation_movement.getCausality(), self.assertEquals(simulation_movement.getCausality(),
'business_process_module/test_bp/shipping') 'business_process_module/test_bp/invoice')
tax_invoice_line = invoice_line_list[1] tax_invoice_line = invoice_line_list[1]
self.assertEquals(tax_invoice_line.getResource(), self.assertEquals(tax_invoice_line.getResource(),
'service_module/vat_low') 'service_module/vat_low')
self.assertAlmostEquals(tax_invoice_line.getQuantity(), self.assertAlmostEquals(tax_invoice_line.getQuantity(),
1.0 * (number_of_sale_order_lines \ commodity_invoice_line.getPrice() \
+ number_of_additional_sale_packing_list_lines) \ * (number_of_sale_order_lines \
+ number_of_additional_sale_packing_list_lines) \
* number_of_sale_orders) * number_of_sale_orders)
simulation_movement_list \ simulation_movement_list \
= tax_invoice_line.getDeliveryRelatedValueList() = tax_invoice_line.getDeliveryRelatedValueList()
...@@ -565,7 +572,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -565,7 +572,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
self.assertEquals(simulation_movement.getPortalType(), self.assertEquals(simulation_movement.getPortalType(),
'Simulation Movement') 'Simulation Movement')
self.assertEquals(simulation_movement.getCausality(), self.assertEquals(simulation_movement.getCausality(),
'business_process_module/test_bp/shipping') 'business_process_module/test_bp/invoice')
luxury_invoice_line = invoice_line_list[1] luxury_invoice_line = invoice_line_list[1]
self.assertEquals(luxury_invoice_line.getResource(), self.assertEquals(luxury_invoice_line.getResource(),
...@@ -582,13 +589,14 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -582,13 +589,14 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
self.assertEquals(simulation_movement.getPortalType(), self.assertEquals(simulation_movement.getPortalType(),
'Simulation Movement') 'Simulation Movement')
self.assertEquals(simulation_movement.getCausality(), self.assertEquals(simulation_movement.getCausality(),
'business_process_module/test_bp/shipping') 'business_process_module/test_bp/invoice')
high_tax_invoice_line = invoice_line_list[2] high_tax_invoice_line = invoice_line_list[2]
self.assertEquals(high_tax_invoice_line.getResource(), self.assertEquals(high_tax_invoice_line.getResource(),
'service_module/vat_high') 'service_module/vat_high')
self.assertAlmostEquals(high_tax_invoice_line.getQuantity(), self.assertAlmostEquals(high_tax_invoice_line.getQuantity(),
1.0 * number_of_additional_sale_packing_list_lines \ luxury_invoice_line.getPrice() \
* number_of_additional_sale_packing_list_lines \
* number_of_sale_orders) * number_of_sale_orders)
simulation_movement_list \ simulation_movement_list \
= high_tax_invoice_line.getDeliveryRelatedValueList() = high_tax_invoice_line.getDeliveryRelatedValueList()
...@@ -605,8 +613,9 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -605,8 +613,9 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
self.assertEquals(low_tax_invoice_line.getResource(), self.assertEquals(low_tax_invoice_line.getResource(),
'service_module/vat_low') 'service_module/vat_low')
self.assertAlmostEquals(low_tax_invoice_line.getQuantity(), self.assertAlmostEquals(low_tax_invoice_line.getQuantity(),
1.0 * (number_of_sale_order_lines \ commodity_invoice_line.getPrice() \
+ number_of_additional_sale_packing_list_lines) \ * (number_of_sale_order_lines \
+ number_of_additional_sale_packing_list_lines) \
* number_of_sale_orders) * number_of_sale_orders)
simulation_movement_list \ simulation_movement_list \
= low_tax_invoice_line.getDeliveryRelatedValueList() = low_tax_invoice_line.getDeliveryRelatedValueList()
...@@ -625,14 +634,14 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -625,14 +634,14 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
portal = self.getPortal() portal = self.getPortal()
module = portal.sale_packing_list_module module = portal.sale_packing_list_module
for packing_list in module.contentValues(): for packing_list in module.contentValues():
self.assertEquals(module.getCausalityState(), 'solved') self.assertEquals(packing_list.getCausalityState(), 'solved')
def stepCheckDivergedSalePackingLists(self, sequence=None, def stepCheckDivergedSalePackingLists(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
portal = self.getPortal() portal = self.getPortal()
module = portal.sale_packing_list_module module = portal.sale_packing_list_module
for packing_list in module.contentValues(): for packing_list in module.contentValues():
self.assertEquals(module.getCausalityState(), 'diverged') self.assertEquals(packing_list.getCausalityState(), 'diverged')
def stepCheckSalePackingListSimulation(self, sequence=None, def stepCheckSalePackingListSimulation(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -644,7 +653,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -644,7 +653,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
destination_administration = sequence.get('destination_administration') destination_administration = sequence.get('destination_administration')
for packing_list in module.contentValues(portal_type='Sale Packing List'): for packing_list in module.contentValues(portal_type='Sale Packing List'):
self.assertEquals(packing_list.getCausalityState(), 'solved') self.assertEquals(packing_list.getCausalityState(), 'solved')
causality_list = packing_list.getCausalityRelatedValueList() causality_list = packing_list.getCausalityRelatedValueList(portal_type='Applied Rule')
self.assertEquals(len(causality_list), 1) self.assertEquals(len(causality_list), 1)
applied_rule = causality_list[0] applied_rule = causality_list[0]
self.assertEquals(applied_rule.getPortalType(), 'Applied Rule') self.assertEquals(applied_rule.getPortalType(), 'Applied Rule')
...@@ -727,7 +736,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -727,7 +736,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
module = portal.sale_packing_list_module module = portal.sale_packing_list_module
for packing_list in module.contentValues(portal_type='Sale Packing List'): for packing_list in module.contentValues(portal_type='Sale Packing List'):
self.assertEquals(packing_list.getSimulationState(), 'stopped') self.assertEquals(packing_list.getSimulationState(), 'stopped')
packing_list.stop() packing_list.deliver()
self.assertEquals(packing_list.getSimulationState(), 'delivered') self.assertEquals(packing_list.getSimulationState(), 'delivered')
def stepTestResult(self, sequence=None, sequence_list=None, **kw): def stepTestResult(self, sequence=None, sequence_list=None, **kw):
......
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