On Sat, Mar 27, 2010 at 3:32 PM, Ben Bangert <[email protected]> wrote:
> 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).

What about pylons.url?  You need that before you make a request.

-- 
Mike Orr <[email protected]>

-- 
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