[CMF-checkins] SVN: CMF/branches/CMF-1_5-branch/CMFCore/tests/test_CMFCatalogAware.py Change hardcoded tests on security indexes since those couldbe extended with monkey patches for legitimate raisons. It tests now the real value holded by CMFCatalogAware._cmf_security_indexes

Julien Anguenot ja at nuxeo.com
Sat Jul 23 11:11:10 EDT 2005


Log message for revision 37391:
  Change hardcoded tests on security indexes since those couldbe extended with monkey patches for legitimate raisons. It tests now the real value holded by CMFCatalogAware._cmf_security_indexes

Changed:
  U   CMF/branches/CMF-1_5-branch/CMFCore/tests/test_CMFCatalogAware.py

-=-
Modified: CMF/branches/CMF-1_5-branch/CMFCore/tests/test_CMFCatalogAware.py
===================================================================
--- CMF/branches/CMF-1_5-branch/CMFCore/tests/test_CMFCatalogAware.py	2005-07-23 01:51:11 UTC (rev 37390)
+++ CMF/branches/CMF-1_5-branch/CMFCore/tests/test_CMFCatalogAware.py	2005-07-23 15:11:09 UTC (rev 37391)
@@ -32,6 +32,7 @@
 from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
 from Products.CMFCore.tests.base.testcase import LogInterceptor
 
+CMF_SECURITY_INDEXES = CMFCatalogAware._cmf_security_indexes
 
 def physicalpath(ob):
     return '/'.join(ob.getPhysicalPath())
@@ -151,9 +152,9 @@
         l = list(cat.log)
         l.sort()
         self.assertEquals(l, [
-            "reindex /site/foo ('allowedRolesAndUsers',)",
-            "reindex /site/foo/bar ('allowedRolesAndUsers',)",
-            "reindex /site/foo/hop ('allowedRolesAndUsers',)",
+            "reindex /site/foo %s"%str(CMF_SECURITY_INDEXES),
+            "reindex /site/foo/bar %s"%str(CMF_SECURITY_INDEXES),
+            "reindex /site/foo/hop %s"%str(CMF_SECURITY_INDEXES),
             ])
         self.failIf(foo.notified)
         self.failIf(bar.notified)
@@ -172,9 +173,9 @@
         l = list(cat.log)
         l.sort()
         self.assertEquals(l, [
-            "reindex /site/foo ('allowedRolesAndUsers',)",
-            "reindex /site/foo/bar ('allowedRolesAndUsers',)",
-            "reindex /site/foo/hop ('allowedRolesAndUsers',)",
+            "reindex /site/foo %s" %str(CMF_SECURITY_INDEXES),
+            "reindex /site/foo/bar %s" %str(CMF_SECURITY_INDEXES),
+            "reindex /site/foo/hop %s"%str(CMF_SECURITY_INDEXES),
             ])
         self.failIf(foo.notified)
         self.failIf(bar.notified)
@@ -201,7 +202,7 @@
         cat.setObs([foo, missing])
         foo.reindexObjectSecurity()
         self.assertEquals(cat.log,
-                          ["reindex /site/foo ('allowedRolesAndUsers',)"])
+                          ["reindex /site/foo %s"%str(CMF_SECURITY_INDEXES)])
         self.failIf(foo.notified)
         self.failIf(missing.notified)
 
@@ -216,7 +217,7 @@
         cat.setObs([foo, missing])
         foo.reindexObjectSecurity()
         self.assertEquals(cat.log,
-                          ["reindex /site/foo ('allowedRolesAndUsers',)"])
+                          ["reindex /site/foo %s" %str(CMF_SECURITY_INDEXES)])
         self.failIf(foo.notified)
         self.failIf(missing.notified)
         self.assertEqual( len(self.logged), 1 ) # logging because no raise



More information about the CMF-checkins mailing list