

@override_settings(SESSION_COOKIE_HTTPONLY=False)
def test_no_httponly_session_cookie(self):
    request = RequestFactory().get('/')
    response = HttpResponse('Session test')
    middleware = SessionMiddleware()
    middleware.process_request(request)
    request.session['hello'] = 'world'
    response = middleware.process_response(request, response)
    if ('httponly' in settings.SESSION_COOKIE_NAME):
        self.assertFalse(response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])
    self.assertNotIn('httponly', str(response.cookies[settings.SESSION_COOKIE_NAME]))

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/sessions/tests.py SessionMiddlewareTests.test_no_httponly_session_cookie/original