0

So the only thing I can find is how to set a session during testing. What I want is to check if view set session to a particular value.

This is how I imagine this should be like:

c = Client()
response = c.post('/whatever/')
self.assertEqual('wanted value', response.session['my_value'])

So cookie is available, but not session. This cannot be this hard.

4

1 に答える 1

0

ドキュメントに示されているように、クライアントにはsession属性があります。

于 2012-05-09T19:13:44.527 に答える