[CMF-checkins] CVS: CMF/CMFCore/tests - test_FSMetadata.py:1.2

Andy McKay andy@agmweb.ca
Sun, 23 Mar 2003 23:31:40 -0500


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv31528

Modified Files:
	test_FSMetadata.py 
Log Message:
Add tests for Proxy for DTML objects


=== CMF/CMFCore/tests/test_FSMetadata.py 1.1 => 1.2 ===
--- CMF/CMFCore/tests/test_FSMetadata.py:1.1	Wed Mar 12 00:06:33 2003
+++ CMF/CMFCore/tests/test_FSMetadata.py	Sun Mar 23 23:31:08 2003
@@ -15,7 +15,13 @@
         
 class FSMetadata(FSSecurityBase):
 
-    def test_basicPermissions( self ):
+    def _checkProxyRoles(self, obj, roles):
+        """ Test proxy roles on the object """
+        for role in roles:
+            if not obj.manage_haveProxy(role):
+                raise 'Object does not have the "%s" role' % role
+
+    def test_basicPermissions(self):
         """ Test basic FS permissions """
         # check it has a title
         assert(self.ob.fake_skin.test6.title == 'Test object')
@@ -24,6 +30,11 @@
             'Access contents information',
             1,
             ['Manager','Anonymous'])
+    
+    def test_proxy(self):
+        """ Test roles """
+        ob = self.ob.fake_skin.test_dtml
+        self._checkProxyRoles(ob, ['Manager', 'Anonymous'])
 
 def test_suite():
     return TestSuite((