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
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[email protected]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers