[Zope3-Users] doctest w/ formlib and ViewPageTemplateFile

Shaun Cutts shaun at cuttshome.net
Sat Mar 4 11:37:54 EST 2006


Hello list,
 
I was trying to run doctests on a formlib.EditForm-derived object, which
uses ViewPageTemplateFile. The template then tries to access the object; and
for testing I have override with a test template to exercise the object
w/out too much html.
 
To set up the doctest, I use zope.formlib.tests.formSetUp (which calls
placelesssetup.setUp). However, I have problems in the zpt traversing from
"view" to anything else. (I get a TraversalError because cannot adapt my
object to ITraversable).
 
(However, it works from a browser fine.)
 
I notice that (.).namespace/view is somewhere registered as an adapter for
ITraversable. Is this what I need? Is there a convenience function somewhere
to setup this and/or any other adapters I need to get ZPT running for
doctests? Or how should I be doing my setup?
 
Thanks,
- Shaun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20060304/3204a45b/attachment.htm


More information about the Zope3-users mailing list