Commit 2009216b authored by Jérome Perrin's avatar Jérome Perrin

test references are resetted when copy and paste an invoice.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10106 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c330f04c
...@@ -1683,6 +1683,27 @@ class TestInvoice(TestPackingListMixin, ...@@ -1683,6 +1683,27 @@ class TestInvoice(TestPackingListMixin,
sequence_list.addSequenceString(sequence) sequence_list.addSequenceString(sequence)
sequence_list.play(self) sequence_list.play(self)
def testCopyAndPaste(self, run=RUN_ALL_TESTS):
"""Test copy on paste on Invoice.
When an invoice is copy/pasted, references should be resetted.
"""
if not run:
return
accounting_module = self.getAccountingModule()
invoice = accounting_module.newContent(
portal_type=self.invoice_portal_type)
invoice.edit(reference='reference',
source_reference='source_reference',
destination_reference='destination_reference',)
cb_data = accounting_module.manage_copyObjects([invoice.getId()])
copied, = accounting_module.manage_pasteObjects(cb_data)
new_invoice = accounting_module[copied['new_id']]
self.assertNotEquals(invoice.getReference(),
new_invoice.getReference())
self.assertNotEquals(invoice.getSourceReference(),
new_invoice.getSourceReference())
self.assertNotEquals(invoice.getDestinationReference(),
new_invoice.getDestinationReference())
#class TestPurchaseInvoice(TestInvoice): #class TestPurchaseInvoice(TestInvoice):
# order_portal_type = 'Purchase Order' # order_portal_type = 'Purchase Order'
......
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