#16106: Test client session for unauthenticated users
----------------------------+-----------------------------------
Reporter: humanfromearth | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: 1.3 | Severity: Normal
Keywords: testclient | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
----------------------------+-----------------------------------
In
https://docs.djangoproject.com/en/1.3/topics/testing/#django.test.client.Client.session
it says that I can do something like this in my tests:
{{{
def test_something(self):
session = self.client.session
session['somekey'] = 'test'
session.save()
}}}
However if the client is not logged-in, self.client.session returns a dict
which will result in an !AttributeError.
--
Ticket URL: <https://code.djangoproject.com/ticket/16106>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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/django-updates?hl=en.