how to pass a session variable into a test request?

4 views
Skip to first unread message

Phlip

unread,
Nov 12, 2009, 12:46:41 PM11/12/09
to Django users
Djangoes:

This is not working (1.0.1 and 1.1.1):

uri = urlresolvers.reverse('basket')
self.client.session['cart'] = self.cart.pk
response = self.client.post(uri)

The Google traffic on this topic is a confusing mishmash of
workarounds. (Take out the session object and call .save() on it, I
can't because it's not a dict, I'm not logged in yet, etc.) I tried
all that stuff and couldn't affect the bug.

Any tips?

--
Phlip
Reply all
Reply to author
Forward
0 new messages