[Product-Developers] Problem with PTC test setup

Ricardo Alves rsa at eurotux.com
Fri Jun 12 15:55:19 UTC 2009

Andreas Jung wrote:
> Hi there,
> currently writing tests for vs.event - an AT-derived event type for Plone.
> The code works perfectly in reality but the tests don't.
> This is the test setup (everything is straight-forward):
> import vs.event
> PloneTestCase.installProduct('vs.event')
> PloneTestCase.setupPloneSite(products=('vs.event', ),
>                              extension_profiles=('vs.event:default',))

AFAIU, to properly initialize content factories you need to use the 
@onsetup decorator, so this function execution will be deferred until 
the Plone site setup.

def setup_package():
    import vs.event
    zcml.load_config('configure.zcml', vs.event)


I hope it helps.


Ricardo Alves <rsa at eurotux.com>
Eurotux <http://www.eurotux.com> 

More information about the Product-Developers mailing list