mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #13152 -- Ensure the test client saves the session before writing the session key to the cookie, in case the session engine changes the session key.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12806 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -428,6 +428,9 @@ class Client(object):
|
||||
request.session = engine.SessionStore()
|
||||
login(request, user)
|
||||
|
||||
# Save the session values.
|
||||
request.session.save()
|
||||
|
||||
# Set the cookie to represent the session.
|
||||
session_cookie = settings.SESSION_COOKIE_NAME
|
||||
self.cookies[session_cookie] = request.session.session_key
|
||||
@@ -440,9 +443,6 @@ class Client(object):
|
||||
}
|
||||
self.cookies[session_cookie].update(cookie_data)
|
||||
|
||||
# Save the session values.
|
||||
request.session.save()
|
||||
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user