testing problem with path expressions in page templates
Chris Withers <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
When trying to test a template in a unit test, I get the following
exception:
- Expression: <PathExpr standard:u'options/myobject/SomeProperty'>
...
File
"Zope2-2.12.7-py2.6-macosx-10.3-fat.egg/Products/PageTemplates/Expressions.py",
line 79, in boboAwareZopeTraverse
request=request)
File "zope.traversing-3.7.1-py2.6.egg/zope/traversing/adapters.py",
line 136, in traversePathElement
raise LocationError('No traversable adapter found', obj)
- __traceback_info__: ({'content': <MyObject>, 'args': ()}, 'content')
LocationError: ('No traversable adapter found', {'content': <MyObject>,
'args': ()})
'SomeProperty' is, well, a property ;-)
Now, the same template works just fine when used "for real", so I figure
some standard traversal adapter hasn't been registered when the test runs.
What adapter might that be and what's the "right" way to get it
registered in a unit test?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist - [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )