@Franck I am very late to the discussion, but the answer is that browser.py 
includes some nice convenience methods for handling cookies etc.  Check out 
the source code -- it is very readable. 

On Monday, June 13, 2011 6:27:06 AM UTC-4, Franck wrote:
>
> Doesn't it work to request directly your web.application object, like this 
> ?
>
> #application.py
> app = web.application(urls, globals())
>
> #test.py
> class MyTestCase(unittest.TestCase)
>
>     def test_something(self):
>         response = app.request("some_url")
>         self.assertEqual(response.status, "303 See Other")
>         self.assertIn("some string", response.data)
>
> For me it works fine, you just have to make sure your session handler and 
> database access can be reconfigured properly by the testing classes.
>
> Cheers
>
> On Sat, Jun 11, 2011 at 3:04 AM, Anand Chitipothu 
> <anand...@gmail.com<javascript:>
> > wrote:
>
>> > 1) How to pre-populate cookies (It looks like what may need to be done
>> > is manipulating browser.cookiejar via cookielib?)
>>
>> Yes, the cookies are stored in browser.cookiejar.
>>
>> > 2) How to do GET vs. POST vs. PUT vs. DELETE
>>
>> Call browser.do_request with any urllib2.Request object.
>>
>> > 3) How to POST raw data (for example, passing in raw JSON instead of
>> > key=value pairs)
>>
>> browser.open(url, data)
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "web.py" group.
>> To post to this group, send email to we...@googlegroups.com <javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> webpy+un...@googlegroups.com <javascript:>.
>> For more options, visit this group at 
>> http://groups.google.com/group/webpy?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to webpy+unsubscr...@googlegroups.com.
To post to this group, send email to webpy@googlegroups.com.
Visit this group at http://groups.google.com/group/webpy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to