[CMF-checkins] CVS: CMF/CMFCore/tests - test_TypesTool.py:1.7.2.3
Tres Seaver
tseaver@zope.com
Wed, 9 Jan 2002 17:28:13 -0500
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv25819/CMFCore/tests
Modified Files:
Tag: CMF-1_2-branch
test_TypesTool.py
Log Message:
- Backing out Jeffrey's feature, as it breaks the add list for
the types tool (Tracker #409 won't land for CMF 1.2 b2).
=== CMF/CMFCore/tests/test_TypesTool.py 1.7.2.2 => 1.7.2.3 ===
getUserName = getId
- def has_permission(self, permission, obj):
- # For types tool tests dealing with filtered_meta_types
- return 1
-
def allowed( self, object, object_roles=None ):
# for testing permissions on actions
if object.getId() == 'actions_dummy':
@@ -109,10 +105,6 @@
def extra_meta_types():
return ( { 'name' : 'Dummy', 'action' : 'manage_addFolder' }, )
-class DummyTypeInfo(TypeInformation):
- """ new class of type info object """
- meta_type = "Dummy Test Type Info"
-
class TypesToolTests( unittest.TestCase ):
def setUp( self ):
@@ -190,34 +182,10 @@
custom_view = utils._getViewFor( dummy, view='view2' )()
unpermitted_view = utils._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_AddingOtherTypeInfos(self):
- addTypeFactory(DummyTypeInfo)
- tool = self.root.portal_types
- type_type = DummyTypeInfo.meta_type
-
- fmt = [ mt['name'] for mt in tool.filtered_meta_types() ]
- self.failUnless(DummyTypeInfo.meta_type in fmt,
- "Subfactory meta type not registered")
-
- atif = tool.manage_addTypeInfoForm(self.root.REQUEST,
- type_type=type_type)
- self.failUnless(atif.find(type_type) > -1,
- "'%s' not found in type info form" % type_type)
-
- tool.manage_addTypeInformation(id='foo_default', type_type=None)
- fd = tool.foo_default
- self.failUnless(isinstance(fd, FactoryTypeInformation))
- self.failIf(isinstance(fd, DummyTypeInfo))
-
- tool.manage_addTypeInformation(id='foo_sub', type_type=type_type)
- fs = tool.foo_sub
- self.failUnless(isinstance(fs, DummyTypeInfo), fs.__class__)
-
+ assert default_view == 'view'
+ assert custom_view == 'view2'
+ assert unpermitted_view != 'edit'
+ assert unpermitted_view == 'view'
class TypeInfoTests( unittest.TestCase ):
@@ -571,8 +539,6 @@
ti.constructInstance( folder, 'dust' )
majyk_dust = folder._getOb( 'majyk_dust' )
self.assertEqual( majyk_dust.id, 'majyk_dust' )
-
-
def test_suite():
suite = unittest.TestSuite()