Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: whit <d.w.morriss-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: debugging layers
Newsgroups: gmane.comp.web.zope.plone.devel
Date: Tuesday 3rd October 2006 14:26:58 UTC (over 11 years ago)
little heads up(my apologies to rocky for being the spacemonkey here).

PTC trunk is now using layers(Products.PloneTestCase.layer.ZCMLLayer) to 
load up the component architecture.  This will mainly effect the more 
intrepid of you create code and tests using the CA.  Here are the 
following things to consider:

* ZCMLLayer loads *all* your CA. this means any calls to 
Five.zcml.load_* need to be removed(now redundant, they can only cause 
problems). Likewhise, calls to provideAdapter, provideUtility, etc 
should not got in tests deriving from PloneTestCase(they should go in 
unit tests only, tsk, tsk...).


* ZCMLLayer tears down the CA. therefore, any calls to tearDown or 
cleanUp from zope.testing will cause the next tests depending on the CA 
to raise ComponentLookUpErrors.

* versions of ZopeTestCase before the one packaged in zope 2.9.5 have a 
bug in layer handling that effects doctests. If you have to use PTC 
trunk but can't upgrade, you can workaround like so::


def test_suite():
     from Products.PloneTestCase.layer import ZCMLLayer
     # make suites
...
     suite.layer = ZCMLLayer
     return suite


note: ZCMLLayer loads all the zcml via loading etc/site.zcml; this means 
all the zcml in Products are loaded, so you may be testing interactions 
between loaded Products, not just the code in the test's package.

More on Layers:

http://bfhammer.blogspot.com/2006/08/more-on-layers.html

-w


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
 
CD: 3ms