Re: [Zope-dev] testing problem with path expressions in page templates

2010-08-27 Thread Chris Withers
Marius Gedminas wrote: What adapter might that be and what's the right way to get it registered in a unit test? DefaultTraversable, I think, and from zope.app.testing import setup setup.setUpTraversal() Various other features need various other components, e.g. if your

[Zope-dev] testing problem with path expressions in page templates

2010-08-26 Thread Chris Withers
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

Re: [Zope-dev] testing problem with path expressions in page templates

2010-08-26 Thread Marius Gedminas
On Fri, Aug 27, 2010 at 12:47:11AM +0100, Chris Withers wrote: When trying to test a template in a unit test, I get the following exception: ... LocationError: ('No traversable adapter found', {'content': MyObject, 'args': ()}) ... Now, the same template works just fine when used for real,