[Zope-CMF] Re: SVN: CMF/branches/tseaver-viewification/CMFDefault/tests/test_DiscussionReply.py Fix test breakage due to multiple registrations of five:traversable.

yuppie y.2005- at wcm-solutions.de
Fri Dec 2 14:23:17 EST 2005


Tres Seaver wrote:
> Log message for revision 40501:
>   Fix test breakage due to multiple registrations of five:traversable.
> 
> Changed:
>   U   CMF/branches/tseaver-viewification/CMFDefault/tests/test_DiscussionReply.py
> 
> -=-
> Modified: CMF/branches/tseaver-viewification/CMFDefault/tests/test_DiscussionReply.py
> ===================================================================
> --- CMF/branches/tseaver-viewification/CMFDefault/tests/test_DiscussionReply.py	2005-12-02 18:58:00 UTC (rev 40500)
> +++ CMF/branches/tseaver-viewification/CMFDefault/tests/test_DiscussionReply.py	2005-12-02 19:07:57 UTC (rev 40501)
> @@ -21,13 +21,26 @@
>  import Products
>  from AccessControl.SecurityManagement import newSecurityManager
>  from AccessControl.SecurityManagement import noSecurityManager
> +from Products.Five.fiveconfigure import cleanUp
>  from Products.Five import zcml
>  
>  from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
>  from Products.CMFCore.tests.base.testcase import PlacelessSetup
>  from Products.CMFCore.tests.base.testcase import RequestTest
>  
> +_DOCUMENT_TRAVERSE_ZCML = """\
> +<configure
> +    xmlns="http://namespaces.zope.org/zope"
> +    xmlns:five="http://namespaces.zope.org/five"
> +    >
>  
> +  <five:traversable
> +     class="Products.CMFDefault.Document.Document"
> +     />
> +
> +</configure>
> +"""
> +
>  class DiscussionReplyTest(PlacelessSetup, RequestTest):
>  
>      def setUp(self):
> @@ -39,8 +52,10 @@
>          zcml.load_config('configure.zcml', Products.CMFCore)
>          zcml.load_config('configure.zcml', Products.DCWorkflow)
>          zcml.load_string(_TRAVERSE_ZCML)
> +        zcml.load_string(_DOCUMENT_TRAVERSE_ZCML)
>          try:
> -            factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
> +            factory = self.root.manage_addProduct[
> +                                        'CMFDefault'].addConfiguredSite
>              factory('cmf', 'CMFDefault:default', snapshot=False)
>              self.portal = self.root.cmf
>              # Become a Manager
> @@ -60,6 +75,7 @@
>  
>      def tearDown(self):
>          noSecurityManager()
> +        cleanUp()
>          RequestTest.tearDown(self)
>          PlacelessSetup.tearDown(self)

Is this extra cleanUp() necessary? I thought 
PlacelessSetup.tearDown(self) calls it already.

Cheers, Yuppie



More information about the Zope-CMF mailing list