[CMF-checkins] CVS: CMF/CMFDefault/tests - test_MetadataTool.py:1.5

Florent Guillaume fg@nuxeo.com
Fri, 5 Jul 2002 15:45:06 -0400


Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv2727/CMFDefault/tests

Modified Files:
	test_MetadataTool.py 
Log Message:
Fixed the Types Tool so that TypeInformation's Title is decorrelated
from its Id (the old TypeInformation.Type() should not be used anymore).

The Id is what gets put in the "portal_type" attribute of a content
object, which one gets at using somecontent.getPortalTypeName(). The
Title is returned by somecontent.Type().

"portal_type" is now indexed, and in most cases should be used when
doing catalog queries instead of "Type". Note that when upgrading from
older versions this index will have to be added by hand (see
INSTALL.txt).

Fixed PortalFolder's filtering so that it correctly restricts itself to
the portal types allowed by the TypesTool (Tracker #483).



=== CMF/CMFDefault/tests/test_MetadataTool.py 1.4 => 1.5 ===
         pass # skip DDCI's default values
 
-    def Type( self ):
+    def getPortalTypeName( self ):
         return 'Foo'
 
 class Bar( Foo ):
 
-    def Type( self ):
+    def getPortalTypeName( self ):
         return 'Bar'
 
 class TestMetadataTool( TestCase ):
@@ -308,7 +308,7 @@
         foo     = Foo()
         tSpec   = self.tool.getElementSpec( 'Title' )
         tSpec.addPolicy( 'Foo' )
-        tPolicy = tSpec.getPolicy( foo.Type() )
+        tPolicy = tSpec.getPolicy( foo.getPortalTypeName() )
         tPolicy.edit( 1, 0, '', 0, () )
 
         try:
@@ -345,7 +345,7 @@
 
         tSpec   = self.tool.getElementSpec( 'Title' )
         tSpec.addPolicy( 'Foo' )
-        tPolicy = tSpec.getPolicy( foo.Type() )
+        tPolicy = tSpec.getPolicy( foo.getPortalTypeName() )
         tPolicy.edit( 1, 0, '', 0, () )
 
         try: