Installing a python package for tests
Sidnei da Silva
sidnei at enfoldsystems.com
Sat Sep 15 03:28:48 UTC 2007
On 9/14/07, Martin Aspeli <optilude at gmx.net> wrote:
> You need to separate ZCML processing from Zope product loading in your mind.
Trust me, I do.
> plone.session is probably not a Zope 2 product. Then, you don't need
> installPackage at all. You can just use it so long as it's in your
> pythonpath. You may need to load its ZCML in a test layer, of course.
>
> installPackage() is needed only for Zope 2 products. To be a Zope 2
> product, a package needs to use <five:registerPackage /> in its ZCML,
> and this needs to have been loaded before installPackage() is called.
As Wiggy replied, it is a Zope 2 product.
> Here's an example that hooks into the PloneTestCase main Plone ZCML
> layer. It loads some ZCML and installs a package as a product with
> installPackage().
>
> http://dev.plone.org/collective/browser/borg/components/borg.project/trunk/borg/project/tests.py
That's similar to what I did. It feels very clunky though. Isn't there
a better way to do it? Say, have installPackage do registerPackage
also?
--
Sidnei da Silva
Enfold Systems http://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
More information about the Product-Developers
mailing list