On Dec 5, 2007, at 12:17 PM, Wichert Akkerman wrote:
> Previously Andreas Zeidler wrote:
>> # apply plone profile to register local utilities etc
>> setup_tool = portal.portal_setup
>> setup_tool.setImportContext('') # pass empty id to re-
>> apply current state (snapshot)
>> setup_tool.runAllImportSteps()
>
> That killed the base profile in all versions of Plone 3. It has never
> been a valid thing to do.
yes, it sure looked nasty, but i ran into that code when looking into
ways of moving the creation of sample content onto the layer, and it
worked... :)
> I'm not sure what 're-apply the current state'
> would even do. and I feel I know GS reasonably well by now :)
well, this is why i'm asking you, isn't it? :) anyway, it did the
trick — without it stuff from the portal was missing at that stage,
i.e. utilities etc.
> I don't know what your exact needs are.
i'd like to create some sample content to test linkintegrity with, and
i don't want to put that into `afterSetUp`, since this would repeat it
for every single test making things much slower. a quick look at
http://dev.plone.org/plone/browser/plone.app.linkintegrity/tags/1.0.2/plone/app/linkintegrity/tests/layer.py
should give you the basic idea.
i thought that was one of the original motivations for using layers,
but maybe i got that wrong. i completely agree that needing this hack
to make it work is indeed nasty, and i'd also like to do this in a
saner way, but how? what's the best practice of using a layer to
create sample content for your tests?
> If you want to make sure your
> steps are registered you can use applyContext(context_id). If you want
> to import steps from a profile you use runAllImportStepsFromProfile.
neither seems to do the same — i've spent the last 1.5 hours trying
various things like that, but no luck. :)
andi
--
zeidler it consulting -
http://zitc.de/ -
[hidden email]
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at
http://zitc.de/pgp -
http://wwwkeys.de.pgp.net/plone 3.0.3 released! --
http://plone.org/products/plone -------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers