[Erp5-report] r17829 - /erp5/trunk/products/ERP5/tests/testInventoryAPI.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 27 17:20:37 CET 2007


Author: aurel
Date: Tue Nov 27 17:20:35 2007
New Revision: 17829

URL: http://svn.erp5.org?rev=17829&view=rev
Log:
test that when inserting movement in the past, after a reindexation of
full inventory, everything is ok
this test failed for now

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

Modified: erp5/trunk/products/ERP5/tests/testInventoryAPI.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInventoryAPI.py?rev=17829&r1=17828&r2=17829&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInventoryAPI.py (original)
+++ erp5/trunk/products/ERP5/tests/testInventoryAPI.py Tue Nov 27 17:20:35 2007
@@ -1894,6 +1894,31 @@
     self._checkInventoryList(inventory, reference_inventory,
                              ordered_check=True)
 
+  def test_13_InventoryAfterModificationInPast(self):
+    """
+    Test inventory after adding a new movement in past and reindex all inventory
+    """
+    movement = self._makeMovement(quantity=self.BASE_QUANTITY*2,
+      start_date=self.INVENTORY_DATE_3 - 2,
+      simulation_state='delivered')
+    # reindex inventory module, although we modified table by hand
+    # everything must be consistent after reindexation
+    inventory_module = self.getPortal().getDefaultModule(portal_type='Inventory')
+    inventory_module.recursiveReindexObject()
+    get_transaction().commit()
+    self.tic()
+    inventory_kw={'node_uid': self.node_uid,
+                  'at_date': self.INVENTORY_DATE_3}
+    value=self.INVENTORY_QUANTITY_3
+    # use optimisation
+    self.assertEquals(value, self.getInventory(**inventory_kw))
+    # without optimisation
+    self.assertEquals(value,
+                      self.getInventory(optimisation__=False,
+                                        **inventory_kw))
+
+
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestInventory))




More information about the Erp5-report mailing list