Thank you very much. It works now!<br><br>---<br>Noe<br><br><div class="gmail_quote">2012/4/11 Christian Klinger <span dir="ltr">&lt;<a href="mailto:cklinger@novareto.de">cklinger@novareto.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Noe,<br>
<br>
you have to call in notify not the interface of the event, you have to call the event itself. This works in my applications:<br>
<br>
    def test_event(self):<br>
        import grok<br>
        root = self.layer.getRootFolder()<br>
        root[&#39;app&#39;] = app = Grokbackground()<br>
        grok.notify(grok.<u></u>ApplicationInitializedEvent(<u></u>app))<br>
<br>
You can access the app in the subscriber via event.object.<br>
<br>
<br>
@grok.subscribe(grok.<u></u>IApplicationInitializedEvent)<br>
def handle_it(event):<br>
    print event.object<br>
<br>
HTH Christian<br>
<br>
<br>
Noe Nieto schrieb:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
I&#39;m doing integration testing and my app has an event subscription to<br>
grok.<u></u>IApplicationInitializedEvent.<br>
<br>
When setting up my layer I&#39;m doing the following (layer is<br>
zope.fanstatic.testing.<u></u>ZopeFanstaticBrowserLayer):<br>
<br>
     def setUp(self):<br>
         #Add test app<br>
         from consworks.app import Consworks<br>
         import grok<br>
         self.root = self.layer.getRootFolder()<br>
         self.root[&#39;app&#39;] = Consworks()<br>
         grok.notify(grok.<u></u>IApplicationInitializedEvent)<br>
<br>
<br>
But the handler for IApplicationInitializedEvent is not being called.<br>
What else do I need to do to make it work?<br>
<br>
--<br>
---<br>
Noe Nieto<br>
NNieto Consulting Services<br></div></div>
M: <a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a> &lt;mailto:<a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a>&gt;<br>
W: <a href="http://noenieto.com" target="_blank">http://noenieto.com</a><br>
T: @tzicatl &lt;<a href="https://twitter.com/#%21/tzicatl" target="_blank">https://twitter.com/#%21/<u></u>tzicatl</a>&gt;<br>
Li: Perfil en LinkedIn &lt;<a href="http://www.linkedin.com/profile/view?id=84300665" target="_blank">http://www.linkedin.com/<u></u>profile/view?id=84300665</a>&gt;<br>
<br>
______________________________<u></u>_________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org" target="_blank">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/<u></u>listinfo/grok-dev</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org" target="_blank">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/<u></u>listinfo/grok-dev</a><br>
</blockquote></div><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>