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 <[email protected]>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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 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/webpy?hl=en.