Ticket #6087: ticket_6087__rev_6812.diff
File ticket_6087__rev_6812.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/contrib/sessions/tests.py
66 66 >>> s.accessed, s.modified 67 67 (True, False) 68 68 69 >>> s.setdefault('foo', 'bar') 70 'bar' 71 >>> s.setdefault('foo', 'baz') 72 'bar' 73 69 74 >>> s.accessed = False # Reset the accessed flag 70 75 71 76 >>> s.pop('some key') -
django/contrib/sessions/backends/base.py
51 51 self.modified = self.modified or key in self._session 52 52 return self._session.pop(key, *args) 53 53 54 def setdefault(self, key, value): 55 if key in self._session: 56 return self._session[key] 57 else: 58 self.modified = True 59 self._session[key] = value 60 return value 61 54 62 def set_test_cookie(self): 55 63 self[self.TEST_COOKIE_NAME] = self.TEST_COOKIE_VALUE 56 64