[Erp5-report] r31667 mame - /erp5/trunk/products/ERP5/tests/testItem.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 8 17:47:18 CET 2010


Author: mame
Date: Fri Jan  8 17:47:15 2010
New Revision: 31667

URL: http://svn.erp5.org?rev=31667&view=rev
Log:
Add new test to verify that when same item is attached twice on
the movement, it doesn't cause a conflit

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

Modified: erp5/trunk/products/ERP5/tests/testItem.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testItem.py?rev=31667&r1=31666&r2=31667&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testItem.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testItem.py [utf8] Fri Jan  8 17:47:15 2010
@@ -272,7 +272,6 @@
     resource = self.createVariatedResource()
     # XXX this tests depends on the relative url of the resource
     self.assertEquals('product_module/1', resource.getRelativeUrl())
-
     transaction.commit()
     self.tic()
     packing_list = self.createPackingList(resource=resource,organisation=organisation)
@@ -481,6 +480,52 @@
                                     portal_type='Purchase Packing List Cell')
     self.assertEquals(movement_cell_list,[])
     
+  def test_06_VerifyHavingSameItemTwiceOnMovementCausesNoBug(self):
+    """
+    """
+    organisation = self.createOrganisation(title='Organisation VI')
+    transaction.commit()
+    self.tic()
+    resource = self.createVariatedResource()
+    # XXX this tests depends on the relative url of the resource
+    self.assertEquals('product_module/4', resource.getRelativeUrl())
+
+    transaction.commit()
+    self.tic()
+    packing_list = self.createPackingList(resource=resource,organisation=organisation)
+   
+    packing_list_line= self.createPackingListLine(packing_list=packing_list,
+                                                  resource=resource)
+    transaction.commit()
+    self.tic()				      
+    packing_list_line.DeliveryLine_viewItemCreationDialog()
+    # create a listbox 
+    listbox = ({ 'listbox_key': '000',
+              'title': 'Lot A10',
+              'reference': '1070110000015',
+              'quantity': 20.0,
+              'line_variation_category_list': 'size/product_module/4/3'
+              },
+              )
+
+    self.portal.REQUEST.set('type', 'Item')
+    packing_list_line.DeliveryLine_createItemList(listbox=listbox)
+    transaction.commit()
+    self.tic()
+    item = [x.getObject() for x in self.portal.portal_catalog(
+                                    portal_type='Item',
+                                    reference = '1070110000015'
+                                    )][0]
+    packing_list_cell_list = packing_list_line.contentValues(portal_type='Purchase Packing List Cell')
+    for packing_list_cell in packing_list_cell_list:
+      packing_list_cell.setAggregateValueList(packing_list_cell.getAggregateValueList()+[item])
+    self.portal.portal_workflow.doActionFor(packing_list,
+               'confirm_action')
+    self.assertEquals(packing_list.getSimulationState(),
+              'confirmed')
+    transaction.commit()
+    self.tic()
+    self.assertEquals(packing_list.getCausalityState(),'solved')
 
   def test_select_item_dialog_no_variation(self):
     organisation = self.createOrganisation(title='Organisation III')




More information about the Erp5-report mailing list