Writing a testcase for a Plone 2.5 product - ztc.installPackage isn't available
I've posted this message to the plone-users list, but since nobody has answered and I think it's really related to Zope, I'm reposting the message here. My apologies if you receive this message twice. Hello list, I'm trying to write some automated test for an *eggified* content-type product I'm developing for Plone 2.5. My question is: Is possible to install eggified products in zope-2.9.8 using ZopeTestCase? And now the context: Following the PPD book, I've put the following into the tests/base.py file: *** # base.py from zassh.eventoDeportivo.config import PROJECTNAME from Testing import ZopeTestCase from Products.Five import zcml, fiveconfigure from Products.PloneTestCase.layer import onsetup @onsetup def setup_eventoDeportivo(): fiveconfigure.debug_mode = True import zassh.eventoDeportivo zcml.load_config('configure.zcml', zassh.eventoDeportivo) fiveconfigure.debug_mode = False # Let Zope know about the product we require above-and-beyond a basic # Plone install (PloneTestCase takes care of these). ZopeTestCase.installProduct(PROJECTNAME) # PROJECTNAME = "zassh.eventoDeportivo" # Import PloneTestCase - this registers more products with Zope as a side effect from Products.PloneTestCase.PloneTestCase import PloneTestCase from Products.PloneTestCase.PloneTestCase import setupPloneSite # Set up a Plone site setup_eventoDeportivo() setupPloneSite(products=[PROJECTNAME,]) class eventoDeportivoTestCase(PloneTestCase): """Base class for integration tests for the 'eventoDerpotivo' product. This may provide specific set-up and tear-down operations, or provide convenience methods. """ *** But when running the tests from a buildout, ZopeTestCase can't install the zassh.eventoDeportivo product: dukebody@schrodinger trunk $ bin/instance test -s zassh.eventoDeportivo Running tests at level 1 Installing CMFCore ... done (0.013s) [...] Installing kupu ... done (0.031s) Running Products.PloneTestCase.layer.PloneSite tests: Set up Products.PloneTestCase.layer.ZCML in 1.958 seconds. Installing zassh.eventoDeportivo ... NOT FOUND and obviously all my tests fail. PPD uses ztc.installPackage instead of ztc.installProduct, but the installPackage method isn't availabe in Zope-2.9.8-final, which I'm using with Plone-2.5.3. [1] My question was: Is possible to install eggified products in zope-2.9.8 using ZopeTestCase? If so, what's wrong in my base.py file? Thanks in advance. [1] http://www.archivum.info/zope-checkins@zope.org/2007-06/msg00100.html -- Israel Saeta Pérez http://dukebody.com
Israel Saeta Pérez wrote at 2008-8-23 18:57 +0200:
... My question is: Is possible to install eggified products in zope-2.9.8 using ZopeTestCase?
I think that eggified products are automatically recognized only with Zope 2.11 -- even in standard (non test) operation. -- Dieter
Hello, On Thu, Aug 28, 2008 at 7:54 PM, Dieter Maurer <dieter@handshake.de> wrote:
Israel Saeta Pérez wrote at 2008-8-23 18:57 +0200:
... My question is: Is possible to install eggified products in zope-2.9.8 using ZopeTestCase?
I think that eggified products are automatically recognized only with Zope 2.11 -- even in standard (non test) operation.
As far as I'm concerned, "Proffessional Plone Development" by Martin Aspeli shows how to setup testing cases for eggified products using Zope 2.10. Martin told me that, because of the way eggs are installed before Zope 2.10 using Five, only eggified products belonging to the magic Products.* namespace work properly with ZopeTestCase and ZEO, so I decided to change the name my product to something like "Products.MyProduct" and now I'm able to test it successfully. Thanks anyways. -- Israel Saeta Pérez http://dukebody.com
participants (2)
-
Dieter Maurer -
Israel Saeta Pérez