Sidnei da Silva wrote:

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?

No.

ZopeTestCase makes you explicitly install products. installProduct() and installPackage() are equivalent, and both perform that function.

The Plone ZCML layer loads the Five site.zcml, which loads all ZCML in Products/*, but not elsewhere. Hence, you need to load that ZCML explicitly.

You can't call installPackage() until ZCML has been processed, however, at ZCML processing time, it's too early to call it, so registerPackage can't call it (not at least because installPackage() is a test-only thing, and registerPackage is used in regular operation). installProduct() is responsible for registering with Control_Panel etc. In fact, that used to happen during ZCML processing in Zope 2.10.4, and it caused all sorts of subtle breakage because Control_Panel is persistent in the ZODB, and at that time you don't have a proper DB connection yet.

--
Acquisition is a jealous mistress


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to