From c3a489d8178a953fcc25bea6fd8a571fdb543978 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sat, 15 Sep 2007 21:44:05 +0000 Subject: [PATCH] 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 --- django/test/client.py | 11 ++++------- 1 file 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()