On Sun, Nov 20, 2011 at 3:13 AM, Ryan <ryan.mckil...@gmail.com> wrote:
> I've got a simple subscriber that's working fine:
> @subscriber(BeforeRender)
> def add_localization(event):
>     request = event.get('request')
>     if not request:
>         request = get_current_request()
>     event['_'] = request._
> Inside of my Pryamid app's main() function:
> ...
> config.scan('app.subscribers')
> ...
> In my integration tests of view code, I'm getting an error:
> TypeError: 'Undefined' object is not callable
>
> It's because the ${_()} function isn't available to Mako because the
> subscriber didn't bind to the event.
> In my test setup I've got:
> self.config = testing.setUp()
>
> What must I do to the configurator object in order to get the events
> working?

Add this in your integration test's setup:

  self.config.scan('app.subscribers')


-- 
http://danielnouri.org

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to