Changeset 9224 for django/trunk/django/contrib/sessions/tests.py
- Timestamp:
- 10/10/08 16:41:12 (3 months ago)
- Files:
-
- django/trunk/django/contrib/sessions/tests.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/sessions/tests.py
r8459 r9224 55 55 >>> DatabaseSession('1').get('cat') 56 56 57 # Do file session tests in an isolated directory, and kill it after we're done. 58 >>> original_session_file_path = settings.SESSION_FILE_PATH 59 >>> import tempfile 60 >>> temp_session_store = settings.SESSION_FILE_PATH = tempfile.mkdtemp() 61 57 62 >>> file_session = FileSession() 58 63 >>> file_session.modified … … 106 111 ImproperlyConfigured: The session storage path '/if/this/directory/exists/you/have/a/weird/computer' doesn't exist. Please set your SESSION_FILE_PATH setting to an existing directory in which Django can store session data. 107 112 113 # Clean up after the file tests 114 >>> settings.SESSION_FILE_PATH = original_session_file_path 115 >>> import shutil 116 >>> shutil.rmtree(temp_session_store) 117 118 # 119 # Cache-based tests 120 # NB: be careful to delete any sessions created; stale sessions fill up the 121 # /tmp and eventually overwhelm it after lots of runs (think buildbots) 122 # 123 108 124 >>> cache_session = CacheSession() 109 125 >>> cache_session.modified … … 145 161 >>> cache_session = CacheSession(cache_session.session_key) 146 162 >>> cache_session.save() 147 >>> CacheSession('1').get('cat')163 >>> cache_session.delete(cache_session.session_key) 148 164 149 165 >>> s = SessionBase()
