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.

@onsetup
def setup_package():
   import vs.event
   zcml.load_config('configure.zcml', vs.event)
   ZopeTestCase.installPackage('vs.event')

setup_package()



I hope it helps.

Ricardo

--
Ricardo Alves <[email protected]>
Eurotux <http://www.eurotux.com>

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

Reply via email to