[Zope3-Users] testbrowser passes but view fails
ksmith93940-dev at yahoo.com
ksmith93940-dev at yahoo.com
Wed Sep 27 12:13:48 EDT 2006
I have a situation where the functional test passes but when the page is actually viewed a ComponentLookupError is raised.
This test passes using zope.testbrowser
>>> browser.open('http://localhost/@@z3d.demo3.index.html')
>>> 'ViewletDemo3' in browser.contents
True
A quick sanity check
>>> browser.open('http://localhost/@@z3d.demo3.index.html')
>>> 'does not exist' in browser.contents
False
When the actual page http://localhost/@@z3d.demo3.index.html is viewed, a
ComponentLookupError is raised
File "C:\Python24\Lib\site-packages\zope\contentprovider\tales.py", line 71, i
n __call__
provider.update()
File "c:\z3_inst\lib\python\zope3demos\viewletdemos\demo3\demo.py", line 26, i
n update
zope.viewlet.interfaces.IViewlet, name='MISSING'')
File "C:\Python24\Lib\site-packages\zope\component\_api.py", line 103, in getM
ultiAdapter
raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<persistent broken test_fps.interfaces.DummyContent inst
ance '\x00\x00\x00\x00\x00\x00\x00\x1f'>, <zope.publisher.browser.BrowserRequest
instance URL=http://localhost:8080/@@z3d.demo3.index.html>,
.browser.viewmeta.MasterpageView object at 0x033FA4B0>, <zope.viewlet.manager.<V
iewletManager providing IDemoViewletManager> object at 0x033FABB0>), <InterfaceC
lass zope.viewlet.interfaces.IViewlet>, 'MISSING')
MISSING does not exist.
class DemoViewletManager(ViewletManagerBase):
""" IDemoViewletManager marker interface """
zope.interface.implements(IDemoViewletManager)
def update(self):
rows=[]
# list all in this directory
for name, object in self.context.items():
# adapt each folder item to IViewlet
rows.append(
zope.component.getMultiAdapter(
(object, self.request, self.__parent__, self),
zope.viewlet.interfaces.IViewlet, name='MISSING')
)
[entry.update() for entry in rows]
self.viewlets = rows
When MISSING is replaced with the correct name the functional tests pass and the view
renders properly. I'm using Zope 3.3.0b2 on python 2.4.3
Am I missing something or is this a possible bug? Thanks.
Kevin Smith
More information about the Zope3-users
mailing list