I&#39;m writing some integration test for our products. I&#39;m placing that tests in a separate package: homeviva.testing<br><br>When I run my test, with zope.testrunner, I&#39;m always having the following traceback:<br>

<br>Error in test test_consworks_views (homeviva.testing.tests.test_dbmodels.ConsworksTestCase)<br>Traceback (most recent call last):<br>  File &quot;/usr/lib64/python2.7/unittest/case.py&quot;, line 318, in run<br>    self.setUp()<br>

  File &quot;/home/tzicatl/Aplicaciones/Codigo/HomeViva/homeviva_trunk/src/homeviva.testing/homeviva/testing/tests/test_dbmodels.py&quot;, line 26, in setUp<br>    self.root[&#39;app&#39;] = Consworks()<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/folder.py&quot;, line 95, in __setitem__<br>

    setitem(self, self.data.__setitem__, name, object)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/contained.py&quot;, line 559, in setitem<br>    notify(event)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.event-3.5.0_1-py2.7.egg/zope/event/__init__.py&quot;, line 23, in notify<br>    subscriber(event)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 24, in dispatch<br>

    zope.component.subscribers(event, None)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.1-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 585, in subscribers<br>

    subscription(*objects)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 32, in objectEventNotify<br>    zope.component.subscribers((event.object, event), None)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>

    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.1-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 585, in subscribers<br>    subscription(*objects)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/grok-1.4.3-py2.7.egg/grok/meta.py&quot;, line 175, in __call__<br>    self._createIntIds(site)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/grok-1.4.3-py2.7.egg/grok/meta.py&quot;, line 216, in _createIntIds<br>

    setupUtility(site, intids, IIntIds)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/grokcore.site-1.5-py2.7.egg/grokcore/site/meta.py&quot;, line 108, in setupUtility<br>    container[name_in_container] = utility<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/btree.py&quot;, line 112, in __setitem__<br>    setitem(self, self._setitemf, key, value)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/contained.py&quot;, line 560, in setitem<br>

    notifyContainerModified(container)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/contained.py&quot;, line 332, in notifyContainerModified<br>    notify(ContainerModifiedEvent(object, *descriptions))<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.event-3.5.0_1-py2.7.egg/zope/event/__init__.py&quot;, line 23, in notify<br>    subscriber(event)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 24, in dispatch<br>

    zope.component.subscribers(event, None)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.1-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 585, in subscribers<br>

    subscription(*objects)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.catalog-3.8.1-py2.7.egg/zope/catalog/catalog.py&quot;, line 197, in reindexDocSubscriber<br>    id = component.getUtility(IIntIds, context=cat).queryId(ob)<br>

  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 169, in getUtility<br>    raise ComponentLookupError(interface, name)<br>ComponentLookupError: (&lt;InterfaceClass zope.intid.interfaces.IIntIds&gt;, &#39;&#39;)<br>

<br>My testcase looks like this:<br><br><br>class ConsworksTestCase(unittest.TestCase):<br>    &quot;&quot;&quot;<br>    TestCase for the Consworks app object<br>    &quot;&quot;&quot;<br>    layer = HomeVivaIntegrationLayer(homeviva.testing)<br>

<br>    def setUp(self):<br>        #Add test app<br>        from consworks.app import Consworks<br>        self.root = self.layer.getRootFolder()<br>        self.root[&#39;app&#39;] = Consworks()<br>        self.app = self.root[&#39;app&#39;]<br>

<br>   def test_here(self):<br>       ....<br><br>I tried to manually  register a Intid utility in my layer, but with no results.<br><br>from zope.app.wsgi.testlayer import BrowserLayer<br>from zope.site.hooks import getSiteManager<br>

from zope.intid.interfaces import IIntIds<br>from zope.intid import IntIds<br><br>class HomeVivaIntegrationLayer(BrowserLayer):<br>    &quot;&quot;&quot;<br>    Integration Layer for HomeViva.<br>    &quot;&quot;&quot;<br>

<br>    def testSetUp(self):<br>        super(HomeVivaIntegrationLayer, self).testSetUp()<br>        # root = self.getRootFolder()<br>        # sm = getSiteManager()<br>        # sm.registerUtility(IntIds(), provided=IIntIds)<br>

        # import pdb; pdb.set_trace( )<br><br><br><br>Anyone has hit this error? how did you fixed it?<br><br><br clear="all"><br>-- <br><span style="color:rgb(255,204,102)">---</span><br>
<span style="color:rgb(204,153,51)">Noe Nieto</span><br>
NNieto Consulting Services<br>
M: <a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a><br>
W: <a href="http://noenieto.com" target="_blank">http://noenieto.com</a><br>
T:  <a href="https://twitter.com/#%21/tzicatl" target="_blank">@tzicatl</a><br>Li: <a href="http://www.linkedin.com/profile/view?id=84300665" target="_blank">Perfil en LinkedIn</a><br><br>