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
This commit is contained in:
Jacob Kaplan-Moss 2007-09-15 21:44:05 +00:00
parent bcf7e9a9fe
commit c3a489d817
1 changed files with 4 additions and 7 deletions

View File

@ -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()