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

some tests were using "transaction" as local variable name, and thus hiding the

transaction module 



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26966 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e5ef10d
This diff is collapsed.
...@@ -163,7 +163,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -163,7 +163,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
self.assertEquals(x_curr_ex_line.getValidationState(), self.assertEquals(x_curr_ex_line.getValidationState(),
'validated') 'validated')
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Purchase Invoice Transaction', portal_type='Purchase Invoice Transaction',
stop_date=DateTime('2008/09/08'), stop_date=DateTime('2008/09/08'),
source_section_value=self.organisation_module.supplier, source_section_value=self.organisation_module.supplier,
...@@ -172,8 +172,8 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -172,8 +172,8 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
destination_debit=500), destination_debit=500),
dict(destination_value=self.account_module.receivable, dict(destination_value=self.account_module.receivable,
destination_credit=500))) destination_credit=500)))
transaction.AccountingTransaction_convertDestinationPrice(form_id='view') invoice.AccountingTransaction_convertDestinationPrice(form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getDestinationTotalAssetPrice(), self.assertEquals(line.getDestinationTotalAssetPrice(),
...@@ -235,7 +235,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -235,7 +235,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
portal_type='Currency Exchange Line') portal_type='Currency Exchange Line')
euro_line.validate() euro_line.validate()
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Purchase Invoice Transaction', portal_type='Purchase Invoice Transaction',
stop_date=DateTime('2008/09/08'), stop_date=DateTime('2008/09/08'),
source_section_value=self.organisation_module.supplier, source_section_value=self.organisation_module.supplier,
...@@ -244,9 +244,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -244,9 +244,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
destination_debit=500), destination_debit=500),
dict(destination_value=self.account_module.receivable, dict(destination_value=self.account_module.receivable,
destination_credit=500))) destination_credit=500)))
transaction.AccountingTransaction_convertDestinationPrice( invoice.AccountingTransaction_convertDestinationPrice(
form_id='view') form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getDestinationTotalAssetPrice(), self.assertEquals(line.getDestinationTotalAssetPrice(),
...@@ -290,7 +290,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -290,7 +290,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
self.assertEquals(x_curr_ex_line.getValidationState(), self.assertEquals(x_curr_ex_line.getValidationState(),
'validated') 'validated')
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Sale Invoice Transaction', portal_type='Sale Invoice Transaction',
start_date=DateTime('2008/09/08'), start_date=DateTime('2008/09/08'),
destination_section_value=self.organisation_module.supplier, destination_section_value=self.organisation_module.supplier,
...@@ -298,9 +298,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -298,9 +298,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
source_debit=500), source_debit=500),
dict(source_value=self.account_module.receivable, dict(source_value=self.account_module.receivable,
source_credit=500))) source_credit=500)))
transaction.AccountingTransaction_convertSourcePrice( invoice.AccountingTransaction_convertSourcePrice(
form_id='view') form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getSourceTotalAssetPrice(), self.assertEquals(line.getSourceTotalAssetPrice(),
...@@ -329,7 +329,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -329,7 +329,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
price_currency=new_currency.getRelativeUrl()) price_currency=new_currency.getRelativeUrl())
euro = self.portal.currency_module.euro euro = self.portal.currency_module.euro
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Purchase Invoice Transaction', portal_type='Purchase Invoice Transaction',
stop_date=DateTime('2008/09/08'), stop_date=DateTime('2008/09/08'),
source_section_value=self.organisation_module.supplier, source_section_value=self.organisation_module.supplier,
...@@ -338,9 +338,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -338,9 +338,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
destination_debit=500), destination_debit=500),
dict(destination_value=self.account_module.receivable, dict(destination_value=self.account_module.receivable,
destination_credit=500))) destination_credit=500)))
transaction.AccountingTransaction_convertDestinationPrice( invoice.AccountingTransaction_convertDestinationPrice(
form_id='view') form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getDestinationTotalAssetPrice(),None) self.assertEquals(line.getDestinationTotalAssetPrice(),None)
...@@ -456,7 +456,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -456,7 +456,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
'validated') 'validated')
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Purchase Invoice Transaction', portal_type='Purchase Invoice Transaction',
stop_date=DateTime('2008/09/08'), stop_date=DateTime('2008/09/08'),
source_section_value=self.organisation_module.supplier, source_section_value=self.organisation_module.supplier,
...@@ -466,9 +466,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -466,9 +466,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
dict(destination_value=self.account_module.receivable, dict(destination_value=self.account_module.receivable,
destination_credit=500))) destination_credit=500)))
transaction.AccountingTransaction_convertDestinationPrice( invoice.AccountingTransaction_convertDestinationPrice(
form_id='view') form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getDestinationTotalAssetPrice(), self.assertEquals(line.getDestinationTotalAssetPrice(),
...@@ -527,7 +527,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -527,7 +527,7 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
self.assertEquals(euro_line2.getValidationState(), self.assertEquals(euro_line2.getValidationState(),
'validated') 'validated')
accounting_module = self.portal.accounting_module accounting_module = self.portal.accounting_module
transaction = self._makeOne( invoice = self._makeOne(
portal_type='Purchase Invoice Transaction', portal_type='Purchase Invoice Transaction',
stop_date=DateTime('2008/09/08'), stop_date=DateTime('2008/09/08'),
source_section_value=self.organisation_module.supplier, source_section_value=self.organisation_module.supplier,
...@@ -536,9 +536,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase): ...@@ -536,9 +536,9 @@ class TestERP5CurrencyMixin(AccountingTestCase,ERP5TypeTestCase):
destination_debit=500), destination_debit=500),
dict(destination_value=self.account_module.receivable, dict(destination_value=self.account_module.receivable,
destination_credit=500))) destination_credit=500)))
transaction.AccountingTransaction_convertDestinationPrice( invoice.AccountingTransaction_convertDestinationPrice(
form_id='view') form_id='view')
line_list = transaction.contentValues( line_list = invoice.contentValues(
portal_type=portal.getPortalAccountingMovementTypeList()) portal_type=portal.getPortalAccountingMovementTypeList())
for line in line_list: for line in line_list:
self.assertEquals(line.getDestinationTotalAssetPrice(), self.assertEquals(line.getDestinationTotalAssetPrice(),
......
...@@ -571,11 +571,11 @@ class TestImmobilisationMixin(ERP5TypeTestCase): ...@@ -571,11 +571,11 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
self.getAccountingModule().manage_delObjects(id_list) self.getAccountingModule().manage_delObjects(id_list)
def stepValidateAccounting(self, sequence=None, sequence_list=None, **kw): def stepValidateAccounting(self, sequence=None, sequence_list=None, **kw):
for transaction in self.getAccountingModule().contentValues(): for accounting_transaction in self.getAccountingModule().contentValues():
transaction.stop() accounting_transaction.stop()
transaction.commit() transaction.commit()
self.tic() self.tic()
transaction.deliver() accounting_transaction.deliver()
transaction.commit() transaction.commit()
self.tic() self.tic()
......
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