Commit 6b1b1a62 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* assert mirrored case for built payment transaction.

* configure payment rule for each test.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33360 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ee1fe65e
...@@ -1502,16 +1502,28 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1502,16 +1502,28 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
} }
for payment_transaction_line in payment_transaction_line_list : for payment_transaction_line in payment_transaction_line_list :
self.assert_( if _isMirrored(payment_transaction_line):
payment_transaction_line.getSourceId() in accounting_lines_layout.keys(), self.assert_(
'unexepected source_id %s' % payment_transaction_line.getSourceId()) payment_transaction_line.getDestinationId() in accounting_lines_layout.keys(),
debit, credit = accounting_lines_layout[ 'unexepected source_id %s' % payment_transaction_line.getDestinationId())
payment_transaction_line.getSourceId()] debit, credit = accounting_lines_layout[
self.assertEquals(debit, payment_transaction_line.getSourceDebit()) payment_transaction_line.getDestinationId()]
self.assertEquals(credit, payment_transaction_line.getSourceCredit()) self.assertEquals(debit, payment_transaction_line.getDestinationDebit())
self.assertNotEquals( self.assertEquals(credit, payment_transaction_line.getDestinationCredit())
len(payment_transaction_line.getDeliveryRelatedValueList( self.assertNotEquals(
portal_type='Simulation Movement')), 0) len(payment_transaction_line.getDeliveryRelatedValueList(
portal_type='Simulation Movement')), 0)
else:
self.assert_(
payment_transaction_line.getSourceId() in accounting_lines_layout.keys(),
'unexepected source_id %s' % payment_transaction_line.getSourceId())
debit, credit = accounting_lines_layout[
payment_transaction_line.getSourceId()]
self.assertEquals(debit, payment_transaction_line.getSourceDebit())
self.assertEquals(credit, payment_transaction_line.getSourceCredit())
self.assertNotEquals(
len(payment_transaction_line.getDeliveryRelatedValueList(
portal_type='Simulation Movement')), 0)
def stepRebuildAndCheckNothingIsCreated(self, sequence, **kw) : def stepRebuildAndCheckNothingIsCreated(self, sequence, **kw) :
""" Calls the DeliveryBuilder again and checks that the accounting module """ Calls the DeliveryBuilder again and checks that the accounting module
...@@ -2076,8 +2088,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -2076,8 +2088,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCreateCurrencies stepCreateCurrencies
stepCreateProducts stepCreateProducts
stepCreateInvoiceTransactionRule stepCreateInvoiceTransactionRule
stepTic
stepUpdateInvoiceTransactionRuleMatrix stepUpdateInvoiceTransactionRuleMatrix
stepCreatePaymentRule
stepUpdatePaymentRuleMatrix
stepValidateInvoiceTransaction stepValidateInvoiceTransaction
stepTic stepTic
stepCreateNotebookFranceCell stepCreateNotebookFranceCell
...@@ -2114,8 +2127,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -2114,8 +2127,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCreateCurrencies stepCreateCurrencies
stepCreateProducts stepCreateProducts
stepCreateInvoiceTransactionRule stepCreateInvoiceTransactionRule
stepTic
stepUpdateInvoiceTransactionRuleMatrix stepUpdateInvoiceTransactionRuleMatrix
stepCreatePaymentRule
stepUpdatePaymentRuleMatrix
stepValidateInvoiceTransaction stepValidateInvoiceTransaction
stepTic stepTic
stepCreateNotebookFranceCell stepCreateNotebookFranceCell
......
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