Ticket #15142: cleanup_session_records_after_invalid_key_test.diff
File cleanup_session_records_after_invalid_key_test.diff, 1.0 KB (added by , 14 years ago) |
---|
-
django/contrib/sessions/tests.py
160 160 def test_invalid_key(self): 161 161 # Submitting an invalid session key (either by guessing, or if the db has 162 162 # removed the key) results in a new key being generated. 163 session = self.backend('1') 164 session.save() 165 self.assertNotEqual(session.session_key, '1') 166 self.assertEqual(session.get('cat'), None) 167 session.delete() 163 try: 164 session = self.backend('1') 165 session.save() 166 self.assertNotEqual(session.session_key, '1') 167 self.assertEqual(session.get('cat'), None) 168 finally: 169 # Be sure to clean up both session records that are now stored in the backend 170 session.delete() 171 session.delete('1') 168 172 169 173 # Custom session expiry 170 174 def test_default_expiry(self):