mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #7416: Modified test client to preserve session when a user logs in. Thanks to lakin.wecker@gmail.com for the report and Eric Holscher for the patch and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -299,7 +299,10 @@ class Client:
|
||||
|
||||
# Create a fake request to store login details.
|
||||
request = HttpRequest()
|
||||
request.session = engine.SessionStore()
|
||||
if self.session:
|
||||
request.session = self.session
|
||||
else:
|
||||
request.session = engine.SessionStore()
|
||||
login(request, user)
|
||||
|
||||
# Set the cookie to represent the session.
|
||||
|
||||
Reference in New Issue
Block a user