diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-15 21:44:05 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-15 21:44:05 +0000 |
| commit | c3a489d8178a953fcc25bea6fd8a571fdb543978 (patch) | |
| tree | 9dd9c0e925e35df9cf7965eb44a6782b1a1ea8e3 | |
| parent | bcf7e9a9fe037eff4d5dea0cdd8c35104590e1a8 (diff) | |
Cleaned up a couple of mistakes (a handful of bugs in the test client) that I missed in [6333].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/test/client.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/django/test/client.py b/django/test/client.py index 8f50f5aef7..6a05d9dd9c 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -133,7 +133,7 @@ class Client: engine = __import__(settings.SESSION_ENGINE, {}, {}, ['']) cookie = self.cookies.get(settings.SESSION_COOKIE_NAME, None) if cookie: - return engine.SessionClass(cookie.value) + return engine.SessionStore(cookie.value) return {} session = property(_session) @@ -250,7 +250,7 @@ class Client: # Create a fake request to store login details request = HttpRequest() - request.session = engine.SessionClass() + request.session = engine.SessionStore() login(request, user) # Set the cookie to represent the session @@ -273,9 +273,6 @@ class Client: Causes the authenticated user to be logged out. """ - try: - Session.objects.get(session_key=self.cookies['sessionid'].value).delete() - except KeyError: - pass - + session = __import__(settings.SESSION_ENGINE, {}, {}, ['']).SessionStore() + session.delete(session_key=self.cookies['sessionid'].value) self.cookies = SimpleCookie() |
