Read response.headers["Set-Cookie"] and use it to construct an
appropriate Cookie header to pass in on the next request. (maybe use
the cookielib or Cookie modules from the standard library to do the
parsing? haven't looked into it myself)
>
>
> # handler unit test
> def test_homepage_handler(self):
> handler = app.HomeHandler(self._app, REQUEST??)
> handler.get()
> self.assertTrue('Hello unknown' in RESPONSE.read()??)
We don't really support this style of testing; I recommend just
sticking with AsyncHTTPTestCase.fetch() instead of trying to call
handler.get/post() directly.
-Ben
On Tue, Sep 28, 2010 at 6:16 AM, Peter Bengtsson <pet...@gmail.com> wrote:> # handler unit test
> def test_homepage_handler(self):
> handler = app.HomeHandler(self._app, REQUEST??)
> handler.get()
> self.assertTrue('Hello unknown' in RESPONSE.read()??)
We don't really support this style of testing; I recommend just
sticking with AsyncHTTPTestCase.fetch() instead of trying to call
handler.get/post() directly.
-Ben
>
>
>
> So, can someone tell me how to mock the integration test by forcing in
> a particular cookie there?
> And can someone tell me how to mock a request and response so that I
> can control the cookies before the get() method is run.