[Erp5-report] r25106 - /erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 14 15:52:14 CET 2009


Author: vincent
Date: Wed Jan 14 15:52:11 2009
New Revision: 25106

URL: http://svn.erp5.org?rev=25106&view=rev
Log:
Prevent test_48_ERP5Site_hotReindexAll from executing if connection string is the same as the alternative one. This prevents taiting the current catalog for following tests.

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

Modified: erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py?rev=25106&r1=25105&r2=25106&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py [utf8] (original)
+++ erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py [utf8] Wed Jan 14 15:52:11 2009
@@ -1426,6 +1426,18 @@
       LOG('Testing... ',0,message)
 
     portal = self.getPortal()
+    self.original_connection_id = 'erp5_sql_connection'
+    self.new_connection_id = 'erp5_sql_connection2'
+    new_connection_string = 'test2 test2'
+
+    # Skip this test if default connection string is not "test test".
+    original_connection = getattr(portal, self.original_connection_id)
+    connection_string = original_connection.connection_string
+    if (connection_string == new_connection_string):
+      message = 'SKIPPED: default connection string is the same as the one for hot-reindex catalog'
+      ZopeTestCase._print(message)
+      LOG('Testing... ',0,message)
+
     portal_category = self.getCategoryTool()
     portal_activities = self.getActivityTool()
     self.base_category = portal_category.newContent(portal_type='Base Category',
@@ -1437,10 +1449,8 @@
     get_transaction().commit()
     self.tic()
     # Create new connectors
-    self.original_connection_id = 'erp5_sql_connection'
-    self.new_connection_id = 'erp5_sql_connection2'
     portal.manage_addZMySQLConnection(self.new_connection_id,'',
-                                      'test2 test2')
+                                      new_connection_string)
     new_connection = portal[self.new_connection_id]
     new_connection.manage_open_connection()
     # Create new catalog




More information about the Erp5-report mailing list