﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15740	Manipulating the test client session doesn't work as documented	Preston Timmons		"The example for manipulating session variables at this url does not work as documented:

http://docs.djangoproject.com/en/1.3/topics/testing/#django.test.client.Client.session

{{{#!python
def test_something(self):
    session = self.client.session
    session['somekey'] = 'test'
    session.save()
}}}

The test client returns a dictionary rather than a session object, unless a session object is manually added to the client or a view is called that initiates a session.

Attached is a patch that modifies the client to return a session object whenever django.contrib.sessions is installed.
"	Bug	closed	Testing framework	1.3	Normal	duplicate		prestontimmons@…	Design decision needed	1	0	0	0	0	0
