On Mar 27, 2010, at 3:40 AM, grassoalvaro wrote:

> i have problem with some automatic tests. Simple example:
> 
> [code]
> 
> from test.tests import *
> from pylons import tmpl_context as c
> 
> class TestBlaController(TestController):
> 
>    def test_index(self):
>        response = self.app.get(url(controller='bla', action='index'))
>        c.test = 'dupa'

Per the testing documentation:
http://pylonshq.com/docs/en/1.0/testing/#testing-pylons-objects

The Pylons globals are *not* available outside a request. You will need to 
utilize response.tmpl_context after the request, which is the actual object 
that was used during that request. (Assuming you're using a Pylons 1.0RC1 
project).

Cheers,
Ben

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

Reply via email to