Commit 05eecaaa authored by Jérome Perrin's avatar Jérome Perrin

follow recent changes in TestAccountingRulesMixin


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22599 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6f4ff9a
......@@ -335,7 +335,7 @@ class TestInvoiceMixin(TestPackingListMixin,
"""
packing_list = sequence.get('packing_list')
related_invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.sale_invoice_transaction_portal_type)
portal_type=self.invoice_transaction_portal_type)
packing_list_building_state = 'started'
packing_list_state = packing_list.getSimulationState()
......@@ -374,8 +374,8 @@ class TestInvoiceMixin(TestPackingListMixin,
# Then, test if each Invoice movement is equals to the sum of somes
# Simulation Movements
for invoice_movement in invoice.getMovementList(portal_type = [
self.sale_invoice_cell_portal_type,
self.sale_invoice_line_portal_type]) :
self.invoice_cell_portal_type,
self.invoice_line_portal_type]) :
related_simulation_movement_list = invoice_movement.\
getDeliveryRelatedValueList(portal_type='Simulation Movement')
quantity = 0
......@@ -535,7 +535,7 @@ class TestInvoiceMixin(TestPackingListMixin,
coping the atributes from packing list to invoice."""
packing_list = sequence.get('packing_list')
related_invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.sale_invoice_transaction_portal_type)
portal_type=self.invoice_transaction_portal_type)
self.assertEquals(len(related_invoice_list), 1)
invoice = related_invoice_list[0]
self.assertEquals(packing_list.getSource(), invoice.getSource())
......@@ -625,14 +625,14 @@ class TestInvoiceMixin(TestPackingListMixin,
# Now we will check that we have two invoices created
packing_list = sequence.get('packing_list')
invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.sale_invoice_transaction_portal_type)
portal_type=self.invoice_transaction_portal_type)
self.assertEquals(len(invoice_list),1)
invoice = invoice_list[0]
self.assertEquals(invoice.getSimulationState(), 'confirmed')
sequence.edit(invoice=invoice)
new_packing_list = sequence.get('new_packing_list')
new_invoice_list = new_packing_list.getCausalityRelatedValueList(
portal_type=self.sale_invoice_transaction_portal_type)
portal_type=self.invoice_transaction_portal_type)
self.assertEquals(len(new_invoice_list),1)
new_invoice = new_invoice_list[0]
self.assertEquals(new_invoice.getSimulationState(), 'confirmed')
......@@ -652,13 +652,13 @@ class TestInvoiceMixin(TestPackingListMixin,
invoice = sequence.get('invoice')
new_invoice = sequence.get('new_invoice')
self.assertEquals(3,len(invoice.objectValues(
portal_type=self.sale_invoice_transaction_line_portal_type)))
portal_type=self.invoice_transaction_line_portal_type)))
self.assertEquals(3,len(new_invoice.objectValues(
portal_type=self.sale_invoice_transaction_line_portal_type)))
portal_type=self.invoice_transaction_line_portal_type)))
account_module = self.getAccountModule()
found_dict = {}
for line in invoice.objectValues(
portal_type=self.sale_invoice_transaction_line_portal_type):
portal_type=self.invoice_transaction_line_portal_type):
source_id = line.getSourceId()
found_dict[source_id] = line.getQuantity()
total_price = (self.default_quantity-1) * self.default_price
......@@ -672,7 +672,7 @@ class TestInvoiceMixin(TestPackingListMixin,
self.assertAlmostEquals(expected_dict[key],found_dict[key],places=2)
found_dict = {}
for line in new_invoice.objectValues(
portal_type=self.sale_invoice_transaction_line_portal_type):
portal_type=self.invoice_transaction_line_portal_type):
source_id = line.getSourceId()
found_dict[source_id] = line.getQuantity()
total_price = 1 * self.default_price
......
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