[Product-Developers] Problem with PTC test setup

Andreas Jung lists at zopyx.com
Fri Jun 12 16:03:25 UTC 2009


On 12.06.09 17:55, Ricardo Alves wrote:
> 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() 
Thanks for the evil and magical boilerplate - it's working now.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090612/75a10789/attachment.vcf>


More information about the Product-Developers mailing list