[Erp5-report] r17483 - /erp5/trunk/products/ERP5Catalog/tests/testArchive.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 9 10:10:45 CET 2007


Author: aurel
Date: Fri Nov  9 10:10:45 2007
New Revision: 17483

URL: http://svn.erp5.org?rev=17483&view=rev
Log:
test that when we reindex an object in an archive, it goes only in the archive

Modified:
    erp5/trunk/products/ERP5Catalog/tests/testArchive.py

Modified: erp5/trunk/products/ERP5Catalog/tests/testArchive.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Catalog/tests/testArchive.py?rev=17483&r1=17482&r2=17483&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Catalog/tests/testArchive.py (original)
+++ erp5/trunk/products/ERP5Catalog/tests/testArchive.py Fri Nov  9 10:10:45 2007
@@ -280,6 +280,8 @@
     self.checkRelativeUrlInSQLPathList(path_list, connection_id=self.archive_connection_id)
 
     # Create a new movement and check it goes only in new catalog
+    import pdb
+    pdb.set_trace()
     self.assertEqual(len(self.folder.searchFolder(portal_type="Dummy Movement")), 0)
     self.assertEquals(100, getInventory(node_uid=self.node.getUid()))
     self.new_mvt = self._makeMovement(quantity=50, stop_date=DateTime("2006/08/06"),
@@ -319,6 +321,25 @@
     # As we only have first movement in archive, inventory must be 100
     self.assertEquals(100, getInventory(node=self.node.getRelativeUrl()))
 
+    # go on current catalog
+    self.pref.edit(preferred_archive=None)
+    get_transaction().commit()
+    self.tic()
+
+    # unindex and reindex an older movement and check it's well reindexed    
+    self.inventory.unindexObject()
+    get_transaction().commit()
+    self.tic()
+    path_list = [self.inventory.getRelativeUrl()]
+    self.checkRelativeUrlNotInSQLPathList(path_list, connection_id=self.new_connection_id)
+    self.checkRelativeUrlNotInSQLPathList(path_list, connection_id=self.archive_connection_id)
+    self.inventory.reindexObject()
+    get_transaction().commit()
+    self.tic()
+    path_list = [self.inventory.getRelativeUrl()]
+    self.checkRelativeUrlNotInSQLPathList(path_list, connection_id=self.new_connection_id)
+    self.checkRelativeUrlInSQLPathList(path_list, connection_id=self.archive_connection_id)
+
 
 def test_suite():
   suite = unittest.TestSuite()




More information about the Erp5-report mailing list