[CMF-checkins] SVN: CMF/trunk/CMF - refactored conformance tests

Yvo Schubbe y.2006_ at wcm-solutions.de
Mon May 29 10:19:26 EDT 2006


Log message for revision 68344:
  - refactored conformance tests
  - added basic SkinnedFolder tests
  - made sure SkinnedFolder implements IContentish

Changed:
  U   CMF/trunk/CMFCalendar/tests/test_Event.py
  A   CMF/trunk/CMFCore/testing.py
  U   CMF/trunk/CMFCore/tests/test_CMFBTreeFolder.py
  U   CMF/trunk/CMFCore/tests/test_PortalFolder.py
  U   CMF/trunk/CMFDefault/SkinnedFolder.py
  D   CMF/trunk/CMFDefault/tests/common.py
  U   CMF/trunk/CMFDefault/tests/test_Document.py
  U   CMF/trunk/CMFDefault/tests/test_Favorite.py
  U   CMF/trunk/CMFDefault/tests/test_File.py
  U   CMF/trunk/CMFDefault/tests/test_Image.py
  U   CMF/trunk/CMFDefault/tests/test_Link.py
  U   CMF/trunk/CMFDefault/tests/test_NewsItem.py
  A   CMF/trunk/CMFDefault/tests/test_SkinnedFolder.py
  U   CMF/trunk/CMFTopic/Topic.py
  U   CMF/trunk/CMFTopic/tests/test_Topic.py

-=-
Modified: CMF/trunk/CMFCalendar/tests/test_Event.py
===================================================================
--- CMF/trunk/CMFCalendar/tests/test_Event.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFCalendar/tests/test_Event.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -20,54 +20,27 @@
 
 from DateTime import DateTime
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.testcase import RequestTest
 
 
-class TestEvent(unittest.TestCase):
+class TestEvent(ConformsToContent, unittest.TestCase):
 
-    def _makeOne(self, id, *args, **kw):
+    def _getTargetClass(self):
         from Products.CMFCalendar.Event import Event
 
-        return Event(id, *args, **kw)
+        return Event
 
-    def test_z2interfaces(self):
-        from Interface.Verify import verifyClass
-        from Products.CMFCore.interfaces.Contentish \
-                import Contentish as IContentish
-        from Products.CMFCore.interfaces.DublinCore \
-                import CatalogableDublinCore as ICatalogableDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import DublinCore as IDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import MutableDublinCore as IMutableDublinCore
-        from Products.CMFCore.interfaces.Dynamic \
-                import DynamicType as IDynamicType
-        from Products.CMFCalendar.Event import Event
+    def _makeOne(self, *args, **kw):
+        return self._getTargetClass()(*args, **kw)
 
-        verifyClass(ICatalogableDublinCore, Event)
-        verifyClass(IContentish, Event)
-        verifyClass(IDublinCore, Event)
-        verifyClass(IDynamicType, Event)
-        verifyClass(IMutableDublinCore, Event)
-
     def test_z3interfaces(self):
         from zope.interface.verify import verifyClass
-        from Products.CMFCalendar.Event import Event
-        from Products.CMFCore.interfaces import ICatalogableDublinCore
-        from Products.CMFCore.interfaces import IContentish
-        from Products.CMFCore.interfaces import IDublinCore
-        from Products.CMFCore.interfaces import IDynamicType
-        from Products.CMFCore.interfaces import IMutableDublinCore
         from Products.CMFCalendar.interfaces import IEvent
         from Products.CMFCalendar.interfaces import IMutableEvent
 
-        verifyClass(ICatalogableDublinCore, Event)
-        verifyClass(IContentish, Event)
-        verifyClass(IDublinCore, Event)
-        verifyClass(IDynamicType, Event)
-        verifyClass(IMutableDublinCore, Event)
-        verifyClass(IEvent, Event)
-        verifyClass(IMutableEvent, Event)
+        verifyClass(IEvent, self._getTargetClass())
+        verifyClass(IMutableEvent, self._getTargetClass())
 
     def test_new(self):
         event = self._makeOne('test')

Copied: CMF/trunk/CMFCore/testing.py (from rev 68272, CMF/trunk/CMFDefault/tests/common.py)
===================================================================
--- CMF/trunk/CMFDefault/tests/common.py	2006-05-25 07:22:05 UTC (rev 68272)
+++ CMF/trunk/CMFCore/testing.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -0,0 +1,80 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" Unit tests mixin classes.
+
+$Id$
+"""
+
+class ConformsToFolder:
+
+    def test_folder_z2interfaces(self):
+        from Interface.Verify import verifyClass
+        from webdav.WriteLockInterface import WriteLockInterface
+        from Products.CMFCore.interfaces.Dynamic \
+                import DynamicType as IDynamicType
+        from Products.CMFCore.interfaces.Folderish \
+                import Folderish as IFolderish
+
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IFolderish, self._getTargetClass())
+        verifyClass(WriteLockInterface, self._getTargetClass())
+
+    def test_folder_z3interfaces(self):
+        from zope.interface.verify import verifyClass
+        from webdav.interfaces import IWriteLock
+        from Products.CMFCore.interfaces import IDynamicType
+        from Products.CMFCore.interfaces import IFolderish
+        from Products.CMFCore.interfaces import IMutableMinimalDublinCore
+
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IFolderish, self._getTargetClass())
+        verifyClass(IMutableMinimalDublinCore, self._getTargetClass())
+        verifyClass(IWriteLock, self._getTargetClass())
+
+
+class ConformsToContent:
+
+    def test_content_z2interfaces(self):
+        from Interface.Verify import verifyClass
+        from Products.CMFCore.interfaces.Contentish \
+                import Contentish as IContentish
+        from Products.CMFCore.interfaces.DublinCore \
+                import CatalogableDublinCore as ICatalogableDublinCore
+        from Products.CMFCore.interfaces.DublinCore \
+                import DublinCore as IDublinCore
+        from Products.CMFCore.interfaces.DublinCore \
+                import MutableDublinCore as IMutableDublinCore
+        from Products.CMFCore.interfaces.Dynamic \
+                import DynamicType as IDynamicType
+
+        verifyClass(ICatalogableDublinCore, self._getTargetClass())
+        verifyClass(IContentish, self._getTargetClass())
+        verifyClass(IDublinCore, self._getTargetClass())
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IMutableDublinCore, self._getTargetClass())
+
+    def test_content_z3interfaces(self):
+        from zope.interface.verify import verifyClass
+        from Products.CMFCore.interfaces import ICatalogableDublinCore
+        from Products.CMFCore.interfaces import IContentish
+        from Products.CMFCore.interfaces import IDublinCore
+        from Products.CMFCore.interfaces import IDynamicType
+        from Products.CMFCore.interfaces import IMutableDublinCore
+        from Products.GenericSetup.interfaces import IDAVAware
+
+        verifyClass(ICatalogableDublinCore, self._getTargetClass())
+        verifyClass(IContentish, self._getTargetClass())
+        verifyClass(IDAVAware, self._getTargetClass())
+        verifyClass(IDublinCore, self._getTargetClass())
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IMutableDublinCore, self._getTargetClass())

Modified: CMF/trunk/CMFCore/tests/test_CMFBTreeFolder.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_CMFBTreeFolder.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFCore/tests/test_CMFBTreeFolder.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -10,7 +10,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-""" Unit test for CMFBTreeFolder
+""" Unit tests for CMFBTreeFolder module.
 
 $Id$
 """
@@ -20,25 +20,24 @@
 import Zope2
 Zope2.startup()
 
+from Products.CMFCore.testing import ConformsToFolder
 
-class CMFBTreeFolderTests(unittest.TestCase):
 
-    def _getTargetClass(self):
+class CMFBTreeFolderTests(ConformsToFolder, unittest.TestCase):
 
+    def _getTargetClass(self):
         from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
+
         return CMFBTreeFolder
 
-    def _makeOne( self, id='test', *args, **kw ):
+    def _makeOne(self, *args, **kw):
+        return self._getTargetClass()(*args, **kw)
 
-        return self._getTargetClass()( id, *args, **kw )
-
     def test_empty( self ):
-
-        empty = self._makeOne()
+        empty = self._makeOne('test')
         self.assertEqual( len( empty.objectIds() ), 0 )
 
     def test___module_aliases__( self ):
-
         from Products.BTreeFolder2.CMFBTreeFolder \
             import CMFBTreeFolder as BBB
 

Modified: CMF/trunk/CMFCore/tests/test_PortalFolder.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_PortalFolder.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFCore/tests/test_PortalFolder.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -34,6 +34,7 @@
 
 from Products.CMFCore.CatalogTool import CatalogTool
 from Products.CMFCore.exceptions import BadRequest
+from Products.CMFCore.testing import ConformsToFolder
 from Products.CMFCore.tests.base.dummy import DummyContent
 from Products.CMFCore.tests.base.dummy import DummyFactory
 from Products.CMFCore.tests.base.dummy import DummySite
@@ -119,17 +120,8 @@
                          , type_name='Dummy Content', id='foo' )
 
 
-class PortalFolderTests(SecurityTest):
+class PortalFolderTests(ConformsToFolder, SecurityTest):
 
-    def setUp(self):
-        SecurityTest.setUp(self)
-        setUpEvents()
-        self.site = DummySite('site').__of__(self.root)
-
-    def tearDown(self):
-        SecurityTest.tearDown(self)
-        cleanUp()
-
     def _getTargetClass(self):
         from Products.CMFCore.PortalFolder import PortalFolder
 
@@ -139,29 +131,26 @@
         return self.site._setObject(id,
                                     self._getTargetClass()(id, *args, **kw))
 
+    def setUp(self):
+        SecurityTest.setUp(self)
+        setUpEvents()
+        self.site = DummySite('site').__of__(self.root)
+
+    def tearDown(self):
+        SecurityTest.tearDown(self)
+        cleanUp()
+
     def test_z2interfaces(self):
         from Interface.Verify import verifyClass
         from OFS.IOrderSupport import IOrderedContainer
-        from webdav.WriteLockInterface import WriteLockInterface
-        from Products.CMFCore.interfaces.Dynamic \
-                import DynamicType as IDynamicType
-        from Products.CMFCore.interfaces.Folderish \
-                import Folderish as IFolderish
 
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IFolderish, self._getTargetClass())
         verifyClass(IOrderedContainer, self._getTargetClass())
-        verifyClass(WriteLockInterface, self._getTargetClass())
 
     def test_z3interfaces(self):
         from zope.interface.verify import verifyClass
-        from Products.CMFCore.interfaces import IDynamicType
-        from Products.CMFCore.interfaces import IFolderish
-        from Products.CMFCore.interfaces import IMutableMinimalDublinCore
+        from OFS.interfaces import IOrderedContainer
 
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IFolderish, self._getTargetClass())
-        verifyClass(IMutableMinimalDublinCore, self._getTargetClass())
+        verifyClass(IOrderedContainer, self._getTargetClass())
 
     def test_contents_methods(self):
         ttool = self.site._setObject( 'portal_types', TypesTool() )

Modified: CMF/trunk/CMFDefault/SkinnedFolder.py
===================================================================
--- CMF/trunk/CMFDefault/SkinnedFolder.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/SkinnedFolder.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -62,6 +62,18 @@
 
     # We derive from CMFCatalogAware first, so we are cataloged too.
 
+    #
+    #   IContentish method
+    #
+
+    security.declareProtected(View, 'SearchableText')
+    def SearchableText(self):
+        """
+        SeachableText is used for full text seraches of a portal.  It
+        should return a concatenation of all useful text.
+        """
+        return "%s %s" % (self.title, self.description)
+
 InitializeClass(SkinnedFolder)
 
 

Deleted: CMF/trunk/CMFDefault/tests/common.py
===================================================================
--- CMF/trunk/CMFDefault/tests/common.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/common.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -1,53 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Unit tests mixin classes.
-
-$Id$
-"""
-
-class ConformsToContent:
-
-    def test_content_z2interfaces(self):
-        from Interface.Verify import verifyClass
-        from Products.CMFCore.interfaces.Contentish \
-                import Contentish as IContentish
-        from Products.CMFCore.interfaces.DublinCore \
-                import CatalogableDublinCore as ICatalogableDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import DublinCore as IDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import MutableDublinCore as IMutableDublinCore
-        from Products.CMFCore.interfaces.Dynamic \
-                import DynamicType as IDynamicType
-
-        verifyClass(ICatalogableDublinCore, self._getTargetClass())
-        verifyClass(IContentish, self._getTargetClass())
-        verifyClass(IDublinCore, self._getTargetClass())
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IMutableDublinCore, self._getTargetClass())
-
-    def test_content_z3interfaces(self):
-        from zope.interface.verify import verifyClass
-        from Products.CMFCore.interfaces import ICatalogableDublinCore
-        from Products.CMFCore.interfaces import IContentish
-        from Products.CMFCore.interfaces import IDublinCore
-        from Products.CMFCore.interfaces import IDynamicType
-        from Products.CMFCore.interfaces import IMutableDublinCore
-        from Products.GenericSetup.interfaces import IDAVAware
-
-        verifyClass(ICatalogableDublinCore, self._getTargetClass())
-        verifyClass(IContentish, self._getTargetClass())
-        verifyClass(IDAVAware, self._getTargetClass())
-        verifyClass(IDublinCore, self._getTargetClass())
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IMutableDublinCore, self._getTargetClass())

Modified: CMF/trunk/CMFDefault/tests/test_Document.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Document.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_Document.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -27,6 +27,7 @@
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from DocumentTemplate.DT_Util import html_quote
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.content import BASIC_HTML
 from Products.CMFCore.tests.base.content import BASIC_STRUCTUREDTEXT
 from Products.CMFCore.tests.base.content import DOCTYPE
@@ -46,9 +47,7 @@
 from Products.CMFCore.TypesTool import TypesTool
 from Products.CMFDefault import utils
 
-from common import ConformsToContent
 
-
 class RequestTestBase(RequestTest):
 
     def _getTargetClass(self):

Modified: CMF/trunk/CMFDefault/tests/test_Favorite.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Favorite.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_Favorite.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -18,12 +18,11 @@
 import unittest
 import Testing
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
 
-from common import ConformsToContent
 
-
 class FavoriteTests(ConformsToContent, unittest.TestCase):
 
     def _getTargetClass(self):

Modified: CMF/trunk/CMFDefault/tests/test_File.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_File.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_File.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -20,10 +20,9 @@
 
 from os.path import join as path_join
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFDefault import tests
 
-from common import ConformsToContent
-
 TESTS_HOME = tests.__path__[0]
 TEST_JPG = path_join(TESTS_HOME, 'TestImage.jpg')
 

Modified: CMF/trunk/CMFDefault/tests/test_Image.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Image.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_Image.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -28,6 +28,7 @@
 from Products.Five import zcml
 from zope.testing.cleanup import cleanUp
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
 from Products.CMFCore.tests.base.security import OmnipotentUser
@@ -36,8 +37,6 @@
 from Products.CMFCore.tests.base.testcase import setUpTraversing
 from Products.CMFDefault import tests
 
-from common import ConformsToContent
-
 TESTS_HOME = tests.__path__[0]
 TEST_JPG = path_join(TESTS_HOME, 'TestImage.jpg')
 

Modified: CMF/trunk/CMFDefault/tests/test_Link.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Link.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_Link.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -20,12 +20,11 @@
 
 from re import compile
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.content import BASIC_RFC822
 from Products.CMFCore.tests.base.content import RFC822_W_CONTINUATION
 
-from common import ConformsToContent
 
-
 class LinkTests(ConformsToContent, unittest.TestCase):
 
     def _getTargetClass(self):

Modified: CMF/trunk/CMFDefault/tests/test_NewsItem.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_NewsItem.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_NewsItem.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -18,15 +18,14 @@
 import unittest
 import Testing
 
+from Products.CMFCore.testing import ConformsToContent
 from Products.CMFCore.tests.base.content import BASIC_HTML
 from Products.CMFCore.tests.base.content import BASIC_STRUCTUREDTEXT
 from Products.CMFCore.tests.base.content import DOCTYPE
 from Products.CMFCore.tests.base.content import ENTITY_IN_TITLE
 from Products.CMFCore.tests.base.testcase import RequestTest
 
-from common import ConformsToContent
 
-
 class NewsItemTests(ConformsToContent, unittest.TestCase):
 
     def _getTargetClass(self):

Added: CMF/trunk/CMFDefault/tests/test_SkinnedFolder.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_SkinnedFolder.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFDefault/tests/test_SkinnedFolder.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" Unit tests for SkinnedFolder module.
+
+$Id$
+"""
+
+import unittest
+import Testing
+
+from Products.CMFCore.testing import ConformsToFolder
+
+
+class SkinnedFolderTests(ConformsToFolder, unittest.TestCase):
+
+    def _getTargetClass(self):
+        from Products.CMFDefault.SkinnedFolder import SkinnedFolder
+
+        return SkinnedFolder
+
+    def test_z2interfaces(self):
+        from Interface.Verify import verifyClass
+        from OFS.IOrderSupport import IOrderedContainer
+
+        verifyClass(IOrderedContainer, self._getTargetClass())
+
+    def test_z3interfaces(self):
+        from zope.interface.verify import verifyClass
+        from OFS.interfaces import IOrderedContainer
+        from Products.CMFCore.interfaces import IContentish
+
+        verifyClass(IContentish, self._getTargetClass())
+        verifyClass(IOrderedContainer, self._getTargetClass())
+
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(SkinnedFolderTests),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: CMF/trunk/CMFDefault/tests/test_SkinnedFolder.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: CMF/trunk/CMFTopic/Topic.py
===================================================================
--- CMF/trunk/CMFTopic/Topic.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFTopic/Topic.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -215,15 +215,4 @@
 
         return tuple( result )
 
-    #
-    #   Cataloging helper to make finding this item easier
-    #
-    security.declareProtected(View, 'SearchableText')
-    def SearchableText(self):
-        """
-        SeachableText is used for full text seraches of a portal.  It
-        should return a concatenation of all useful text.
-        """
-        return "%s %s" % (self.title, self.description)
-
 InitializeClass(Topic)

Modified: CMF/trunk/CMFTopic/tests/test_Topic.py
===================================================================
--- CMF/trunk/CMFTopic/tests/test_Topic.py	2006-05-29 14:12:00 UTC (rev 68343)
+++ CMF/trunk/CMFTopic/tests/test_Topic.py	2006-05-29 14:19:25 UTC (rev 68344)
@@ -21,6 +21,7 @@
 from Acquisition import Implicit
 from zope.testing.cleanup import cleanUp
 
+from Products.CMFCore.testing import ConformsToFolder
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.testcase import SecurityTest
 from Products.CMFCore.tests.base.testcase import setUpEvents
@@ -120,20 +121,11 @@
         return self._max_items
 
 
-class TestTopic(SecurityTest):
+class TestTopic(ConformsToFolder, SecurityTest):
 
     """ Test all the general Topic cases.
     """
 
-    def setUp(self):
-        SecurityTest.setUp(self)
-        setUpEvents()
-        self.site = DummySite('site').__of__(self.root)
-
-    def tearDown(self):
-        SecurityTest.tearDown(self)
-        cleanUp()
-
     def _getTargetClass(self):
         from Products.CMFTopic.Topic import Topic
 
@@ -156,33 +148,32 @@
             self.site._setObject( k, v )
             self.site.portal_catalog._index( document )
 
+    def setUp(self):
+        SecurityTest.setUp(self)
+        setUpEvents()
+        self.site = DummySite('site').__of__(self.root)
+
+    def tearDown(self):
+        SecurityTest.tearDown(self)
+        cleanUp()
+
     def test_z2interfaces(self):
         from Interface.Verify import verifyClass
         from OFS.IOrderSupport import IOrderedContainer
-        from webdav.WriteLockInterface import WriteLockInterface
-        from Products.CMFCore.interfaces.Dynamic \
-                import DynamicType as IDynamicType
-        from Products.CMFCore.interfaces.Folderish \
-                import Folderish as IFolderish
 
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IFolderish, self._getTargetClass())
         verifyClass(IOrderedContainer, self._getTargetClass())
-        verifyClass(WriteLockInterface, self._getTargetClass())
 
     def test_z3interfaces(self):
         from zope.interface.verify import verifyClass
-        from Products.CMFCore.interfaces import IDynamicType
-        from Products.CMFCore.interfaces import IFolderish
-        from Products.CMFCore.interfaces import IMutableMinimalDublinCore
+        from OFS.interfaces import IOrderedContainer
+        from Products.CMFCore.interfaces import IContentish
         from Products.CMFTopic.interfaces import IMutableTopic
         from Products.CMFTopic.interfaces import ITopic
 
-        verifyClass(IDynamicType, self._getTargetClass())
-        verifyClass(IFolderish, self._getTargetClass())
-        verifyClass(IMutableMinimalDublinCore, self._getTargetClass())
+        verifyClass(IContentish, self._getTargetClass())
         verifyClass(IMutableTopic, self._getTargetClass())
         verifyClass(ITopic, self._getTargetClass())
+        verifyClass(IOrderedContainer, self._getTargetClass())
 
     def test_Empty( self ):
         topic = self._makeOne('top')



More information about the CMF-checkins mailing list