[CMF-checkins] CVS: Products/CMFCore/tests - test_TypesTool.py:1.34

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Sep 14 15:02:52 EDT 2004


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv2613/CMFCore/tests

Modified Files:
	test_TypesTool.py 
Log Message:
Merged yuppie-post_1_5-cleanup-branch:
- removed a lot of deprecated code
- made CMFCollector work with CMF 1.4 *and* HEAD


=== Products/CMFCore/tests/test_TypesTool.py 1.33 => 1.34 ===
--- Products/CMFCore/tests/test_TypesTool.py:1.33	Tue Sep  7 04:48:38 2004
+++ Products/CMFCore/tests/test_TypesTool.py	Tue Sep 14 15:02:21 2004
@@ -4,9 +4,6 @@
 Zope.startup()
 from Interface.Verify import verifyClass
 
-from warnings import filterwarnings
-from warnings import filters
-
 from AccessControl import Unauthorized
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
@@ -39,7 +36,6 @@
 from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
 from Products.CMFCore.TypesTool import ScriptableTypeInformation as STI
 from Products.CMFCore.TypesTool import TypesTool
-from Products.CMFCore.utils import _getViewFor
 
 
 class TypesToolTests(SecurityTest):
@@ -47,42 +43,12 @@
     def setUp( self ):
         SecurityTest.setUp(self)
 
-        filterwarnings('ignore', category=DeprecationWarning)
         self.site = DummySite('site').__of__(self.root)
         self.acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
         self.ttool = self.site._setObject( 'portal_types', TypesTool() )
         fti = FTIDATA_DUMMY[0].copy()
         self.ttool._setObject( 'Dummy Content', FTI(**fti) )
 
-    def tearDown(self):
-        del filters[0]
-
-        SecurityTest.tearDown(self)
-
-    def test_processActions( self ):
-        """
-        Are the correct, permitted methods returned for actions?
-        """
-        site = self.site
-        portal = site._setObject( 'portal', PortalFolder(id='portal') )
-        portal.manage_addProduct = { 'FooProduct' : DummyFactory(portal) }
-        portal.invokeFactory( 'Dummy Content', 'actions_dummy' )
-        dummy = portal._getOb( 'actions_dummy' )
-
-        # so we can traverse to it:
-        dummy.view = DummyObject("view")
-        dummy.view2 = DummyObject("view2")
-        dummy.edit = DummyObject("edit")
-
-        default_view = dummy()
-        custom_view = _getViewFor( dummy, view='view2' )()
-        unpermitted_view = _getViewFor( dummy, view='edit' )()
-
-        self.failUnlessEqual(default_view, 'view')
-        self.failUnlessEqual(custom_view, 'view2')
-        self.failIf(unpermitted_view == 'edit')
-        self.failUnlessEqual(unpermitted_view, 'view')
-
     def test_allMetaTypes(self):
         """
         Test that everything returned by allMetaTypes can be
@@ -142,12 +108,6 @@
 
 class TypeInfoTests(TestCase):
 
-    def setUp(self):
-        filterwarnings('ignore', category=DeprecationWarning)
-
-    def tearDown(self):
-        del filters[0]
-
     def test_construction( self ):
         ti = self._makeInstance( 'Foo'
                                , description='Description'
@@ -242,30 +202,6 @@
         self.failUnless( 'edit' in visible )
         self.failUnless( 'objectproperties' in visible )
         self.failIf( 'slot' in visible )
-
-    def test_getActionById( self ):
-        ti = self._makeInstance( 'Foo' )
-        marker = []
-        self.assertEqual( id( ti.getActionById( 'view', marker ) )
-                        , id( marker ) )
-        self.assertRaises( ValueError, ti.getActionById, 'view' )
-
-        ti = self._makeInstance( **FTIDATA_ACTIONS[0] )
-        self.assertEqual( id( ti.getActionById( 'foo', marker ) )
-                        , id( marker ) )
-        self.assertRaises( ValueError, ti.getActionById, 'foo' )
-
-        action = ti.getActionById( 'view' )
-        self.assertEqual( action, '' )
-
-        action = ti.getActionById( 'edit' )
-        self.assertEqual( action, 'foo_edit' )
-
-        action = ti.getActionById( 'objectproperties' )
-        self.assertEqual( action, 'foo_properties' )
-
-        action = ti.getActionById( 'slot' )
-        self.assertEqual( action, 'foo_slot' )
 
     def test_MethodAliases_methods(self):
         ti = self._makeInstance( **FTIDATA_CMF15[0] )



More information about the CMF-checkins mailing list