I created a page template (called 'form') with this content:
<h1 tal:replace="structure here/manage_page_header">Header</h1>
<p>Hello World</p>
<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
Testing this page template from browser works ok, but if I use ZPublisher.Zope('/form') method within an unit test an exception is raised:
Traceback (most recent call last):
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/ZPublisher/Publish.py", line 113, in publish
request, bind=1)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/ZPublisher/Publish.py", line 40, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Shared/DC/Scripts/Bindings.py", line 306, in __call__
return self._bindAndExec(args, kw, None)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/ZopePageTemplate.py", line 256, in _exec
result = self.pt_render(extra_context=bound_names)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/PageTemplate.py", line 102, in pt_render
tal=not source, strictinsert=0)()
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/TAL/TALInterpreter.py", line 190, in __call__
self.interpret(self.program)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/TAL/TALInterpreter.py", line 234, in interpret
handlers[opcode](self, args)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/TAL/TALInterpreter.py", line 569, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/TALES.py", line 221, in evaluate
return expression(self)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/Expressions.py", line 201, in __call__
return self._eval(econtext)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/Expressions.py", line 196, in _eval
return render(ob, econtext.vars)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/Expressions.py", line 95, in render
ob = call_with_ns(ob.__render_with_namespace__, ns)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Products/PageTemplates/Expressions.py", line 75, in call_with_ns
return f(ns)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Shared/DC/Scripts/Bindings.py", line 320, in __render_with_namespace__
return self._bindAndExec((), namevals, namespace)
File "/home/jvg/opt/zope-2.8.0-a1/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/jvg/opt/zope/lib/python/App/special_dtml.py", line 127, in _exec
ns.level = cns.level + 1
AttributeError: level
It seems that testing machinery is broken.
Changes: submitter email, importance (critical => medium)