[Erp5-report] r10106 - /erp5/trunk/products/ERP5/tests/testInvoice.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 18 16:46:00 CEST 2006


Author: jerome
Date: Mon Sep 18 16:45:58 2006
New Revision: 10106

URL: http://svn.erp5.org?rev=10106&view=rev
Log:
test references are resetted when copy and paste an invoice.


Modified:
    erp5/trunk/products/ERP5/tests/testInvoice.py

Modified: erp5/trunk/products/ERP5/tests/testInvoice.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInvoice.py?rev=10106&r1=10105&r2=10106&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py Mon Sep 18 16:45:58 2006
@@ -1683,6 +1683,27 @@
       sequence_list.addSequenceString(sequence)
     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):
 #  order_portal_type = 'Purchase Order'




More information about the Erp5-report mailing list