Author: lukeplant
Date: 2010-09-03 14:04:29 -0500 (Fri, 03 Sep 2010)
New Revision: 13686

Modified:
   django/branches/releases/1.2.X/
   django/branches/releases/1.2.X/docs/topics/testing.txt
Log:
[1.2.X] Fixed #13754 - Add a note about a test client session property gotcha
  
Thanks SmileyChris for report and patch.

Backport of [13685] from trunk.



Property changes on: django/branches/releases/1.2.X
___________________________________________________________________
Name: svnmerge-integrated
   - 
/django/trunk:1-13360,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683
   + 
/django/trunk:1-13360,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683,13685

Modified: django/branches/releases/1.2.X/docs/topics/testing.txt
===================================================================
--- django/branches/releases/1.2.X/docs/topics/testing.txt      2010-09-03 
19:00:43 UTC (rev 13685)
+++ django/branches/releases/1.2.X/docs/topics/testing.txt      2010-09-03 
19:04:29 UTC (rev 13686)
@@ -935,6 +935,15 @@
     A dictionary-like object containing session information. See the
     :doc:`session documentation</topics/http/sessions>` for full details.
 
+    To modify the session and then save it, it must be stored in a variable
+    first (because a new ``SessionStore`` is created every time this property
+    is accessed)::
+
+        def test_something(self):
+            session = self.client.session
+            session['somekey'] = 'test'
+            session.save()
+
 .. _Cookie module documentation: http://docs.python.org/library/cookie.html
 
 Example

-- 
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.

Reply via email to