[CMF-checkins] SVN: CMF/trunk/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:19:52 EDT 2005


Log message for revision 37392:
  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/trunk/CMFCore/tests/test_CMFCatalogAware.py

-=-
Modified: CMF/trunk/CMFCore/tests/test_CMFCatalogAware.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_CMFCatalogAware.py	2005-07-23 15:11:09 UTC (rev 37391)
+++ CMF/trunk/CMFCore/tests/test_CMFCatalogAware.py	2005-07-23 15:19:52 UTC (rev 37392)
@@ -28,6 +28,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())
@@ -147,9 +148,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)
@@ -176,7 +177,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