[CMF-checkins] CVS: CMF/CMFCore/tests - test_DynamicType.py:1.5

Yvo Schubbe y.2004_ at wcm-solutions.de
Thu Feb 5 09:33:33 EST 2004


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

Modified Files:
	test_DynamicType.py 
Log Message:
- added getActionInfo to DynamicType


=== CMF/CMFCore/tests/test_DynamicType.py 1.4 => 1.5 ===
--- CMF/CMFCore/tests/test_DynamicType.py:1.4	Fri Jan  2 07:55:58 2004
+++ CMF/CMFCore/tests/test_DynamicType.py	Thu Feb  5 09:33:32 2004
@@ -20,6 +20,8 @@
 from Products.CMFCore.DynamicType import DynamicType
 from Products.CMFCore.tests.base.dummy import DummyObject
 from Products.CMFCore.tests.base.dummy import DummySite
+from Products.CMFCore.tests.base.dummy import DummyTool
+from Products.CMFCore.tests.base.testcase import SecurityRequestTest
 from Products.CMFCore.tests.base.tidata import FTIDATA_CMF15
 from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
 from Products.CMFCore.TypesTool import TypesTool
@@ -36,13 +38,10 @@
 
     def setUp(self):
         self.site = DummySite('site')
-        self.ttool = self.site._setObject( 'portal_types', TypesTool() )
+        self.site._setObject( 'portal_types', TypesTool() )
         fti = FTIDATA_CMF15[0].copy()
-        self.ttool._setObject( 'Dummy Content 15', FTI(**fti) )
-        self.foo = self.site._setObject( 'foo', DummyContent() )
-
-    def test_getTypeInfo(self):
-        self.assertEqual( self.foo.getTypeInfo().getId(), 'Dummy Content 15' )
+        self.site.portal_types._setObject( 'Dummy Content 15', FTI(**fti) )
+        self.site._setObject( 'foo', DummyContent() )
 
     def test___before_publishing_traverse__(self):
         dummy_view = self.site._setObject( 'dummy_view', DummyObject() )
@@ -68,9 +67,31 @@
         verifyClass(IDynamicType, DynamicType)
 
 
+class DynamicTypeSecurityTests(SecurityRequestTest):
+
+    def setUp(self):
+        SecurityRequestTest.setUp(self)
+        self.site = DummySite('site').__of__(self.root)
+        self.site._setObject( 'portal_membership', DummyTool() )
+        self.site._setObject( 'portal_types', TypesTool() )
+        self.site._setObject( 'portal_url', DummyTool() )
+        fti = FTIDATA_CMF15[0].copy()
+        self.site.portal_types._setObject( 'Dummy Content 15', FTI(**fti) )
+        self.site._setObject( 'foo', DummyContent() )
+
+    def test_getTypeInfo(self):
+        foo = self.site.foo
+        self.assertEqual( foo.getTypeInfo().getId(), 'Dummy Content 15' )
+
+    def test_getActionInfo(self):
+        foo = self.site.foo
+        self.assertEqual( foo.getActionInfo('object/view')['id'], 'view' )
+
+
 def test_suite():
     return TestSuite((
-        makeSuite( DynamicTypeTests ),
+        makeSuite(DynamicTypeTests),
+        makeSuite(DynamicTypeSecurityTests),
         ))
 
 if __name__ == '__main__':




More information about the CMF-checkins mailing list