Commit d2ccf66c authored by Jérome Perrin's avatar Jérome Perrin

use invoice_portal_type everywhere in tests


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22614 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81eef5c8
......@@ -54,14 +54,14 @@ from DateTime import DateTime
class PurchaseInvoiceTest:
invoice_transaction_portal_type = 'Sale Invoice Transaction'
invoice_portal_type = 'Sale Invoice Transaction'
invoice_transaction_line_portal_type \
= "Sale Invoice Transaction Line"
invoice_line_portal_type = "Invoice Line"
invoice_cell_portal_type = "Invoice Cell"
class SaleInvoiceTest:
invoice_transaction_portal_type = 'Sale Invoice Transaction'
invoice_portal_type = 'Sale Invoice Transaction'
invoice_transaction_line_portal_type \
= "Sale Invoice Transaction Line"
invoice_line_portal_type = "Invoice Line"
......@@ -500,7 +500,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
empty_invoice = self.getAccountingModule().newContent(
id = 'empty_invoice',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
start_date = DateTime(2004, 01, 01),
......@@ -528,7 +528,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
simple_invoice = self.getAccountingModule().newContent(
id = 'simple_invoice',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
price_currency = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
......@@ -565,7 +565,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
simple_invoice = self.getAccountingModule().newContent(
id = 'other_simple_invoice',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
start_date = DateTime(2004, 01, 01),
......@@ -655,7 +655,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
simple_invoice = self.getAccountingModule().newContent(
id = 'simple_invoice_two_lines',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
start_date = DateTime(2004, 01, 01),
......@@ -698,7 +698,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
simple_invoice = self.getAccountingModule().newContent(
id = 'simple_invoice_two_cells',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
start_date = DateTime(2004, 01, 01),
......@@ -772,7 +772,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
multi_line_invoice = self.getAccountingModule().newContent(
id = 'multi_line_invoice',
portal_type = self.invoice_transaction_portal_type,
portal_type = self.invoice_portal_type,
resource = currency.getRelativeUrl(),
price_currency = currency.getRelativeUrl(),
stop_date = DateTime(2004, 01, 01),
......
......@@ -335,7 +335,7 @@ class TestInvoiceMixin(TestPackingListMixin,
"""
packing_list = sequence.get('packing_list')
related_invoice_list = packing_list.getCausalityRelatedValueList(
portal_type=self.invoice_transaction_portal_type)
portal_type=self.invoice_portal_type)
packing_list_building_state = 'started'
packing_list_state = packing_list.getSimulationState()
......@@ -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.invoice_transaction_portal_type)
portal_type=self.invoice_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.invoice_transaction_portal_type)
portal_type=self.invoice_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.invoice_transaction_portal_type)
portal_type=self.invoice_portal_type)
self.assertEquals(len(new_invoice_list),1)
new_invoice = new_invoice_list[0]
self.assertEquals(new_invoice.getSimulationState(), 'confirmed')
......
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