mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +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:
parent
d8bfabe98d
commit
50b548d01b
4 changed files with 46 additions and 2 deletions
|
@ -34,3 +34,12 @@ def login_protected_redirect_view(request):
|
|||
"A view that redirects all requests to the GET view"
|
||||
return HttpResponseRedirect('/test_client_regress/get_view/')
|
||||
login_protected_redirect_view = login_required(login_protected_redirect_view)
|
||||
|
||||
def set_session_view(request):
|
||||
"A view that sets a session variable"
|
||||
request.session['session_var'] = 'YES'
|
||||
return HttpResponse('set_session')
|
||||
|
||||
def check_session_view(request):
|
||||
"A view that reads a session variable"
|
||||
return HttpResponse(request.session.get('session_var', 'NO'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue