[Product-Developers] Traversing to an object like the publisher does

Jan Hackel plonecode at hackel.name
Thu May 14 10:02:44 UTC 2009


I need to write a test that essentially needs to traverse to an operation like 
the following tal-expression would:

tal:condition="context/@@plone_context_state/is_view_template"

It seems I cannot use "(un)restrictedTraverse" because it does not trigger my 
custom IPublishTraverse adapter. Using "Request.traverse" looks promising but 
I cannot get authorization to work with it, i.e. I get an 
UnauthorizedException.

Is there a canonical way of simulating the tal-expression given above?

Grüße
Jan Hackel





More information about the Product-Developers mailing list