Commit ff3ad812 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* assert mirrored case for built payment transaction.

* do not remove existing mapped property document in Payment Simulation Rule.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33313 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c4839ceb
...@@ -47,6 +47,7 @@ import transaction ...@@ -47,6 +47,7 @@ import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.Document.MirrorMovementGroup import _isMirrored
from Testing import ZopeTestCase from Testing import ZopeTestCase
from zLOG import LOG, INFO from zLOG import LOG, INFO
...@@ -506,8 +507,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -506,8 +507,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
# clear the message queue, so that it does not contains unexistant paths # clear the message queue, so that it does not contains unexistant paths
self.tic() self.tic()
payment_rule.deleteContent( payment_rule.deleteContent(
[x for x in payment_rule.objectIds()]) [x.getId() for x in payment_rule.objectValues() if \
self.assertEquals(len(payment_rule.objectValues()), 0) x.getPortalType() == self.predicate_portal_type])
self.assertEquals(len(payment_rule.objectValues()), 1)
transaction.commit() transaction.commit()
# and add a new predicate # and add a new predicate
...@@ -1409,16 +1411,28 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1409,16 +1411,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 destination_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 stepCheckAccountingLinesCreatedForMultiLineInvoice( def stepCheckAccountingLinesCreatedForMultiLineInvoice(
self, sequence, **kw) : self, sequence, **kw) :
...@@ -1521,6 +1535,8 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1521,6 +1535,8 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
delivery_tool = self.getPortal().portal_deliveries delivery_tool = self.getPortal().portal_deliveries
# and build again ... # and build again ...
delivery_tool.sale_invoice_transaction_builder.build() delivery_tool.sale_invoice_transaction_builder.build()
delivery_tool.purchase_invoice_transaction_builder.build()
delivery_tool.payment_transaction_builder.build()
if hasattr(delivery_tool, 'pay_sheet_transaction_builder') : if hasattr(delivery_tool, 'pay_sheet_transaction_builder') :
# TODO: conflict with pay_sheet_transaction_builder must be tested too # TODO: conflict with pay_sheet_transaction_builder must be tested too
delivery_tool.pay_sheet_transaction_builder.build() delivery_tool.pay_sheet_transaction_builder.build()
......
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