Code

Ticket #13754: 13754.diff

File 13754.diff, 792 bytes (added by SmileyChris, 4 years ago)
Line 
1diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
2index 9b23d54..66029e7 100644
3--- a/docs/topics/testing.txt
4+++ b/docs/topics/testing.txt
5@@ -906,6 +906,15 @@ can access these properties as part of a test condition.
6     A dictionary-like object containing session information. See the
7     :ref:`session documentation<topics-http-sessions>` for full details.
8 
9+    To modify the session and then save it, it must be stored in a variable
10+    first (because a new ``SessionStore`` is created every time this property
11+    is accessed)::
12+
13+        def test_something(self):
14+            session = self.client.session
15+            session['somekey'] = 'test'
16+            session.save()
17+
18 .. _Cookie module documentation: http://docs.python.org/library/cookie.html
19 
20 Example