Beispiel #1
0
 def test_session_cookie_httponly_with_middleware(self):
     """
     Warn if SESSION_COOKIE_HTTPONLY is off and
     "django.contrib.sessions.middleware.SessionMiddleware" is in
     MIDDLEWARE.
     """
     self.assertEqual(sessions.check_session_cookie_httponly(None), [sessions.W014])
Beispiel #2
0
 def test_session_cookie_httponly_both(self):
     """
     If SESSION_COOKIE_HTTPONLY is off and we find both the session app and
     the middleware, provide one common warning.
     """
     self.assertEqual(sessions.check_session_cookie_httponly(None),
                      [sessions.W015])
Beispiel #3
0
 def test_session_cookie_httponly_with_installed_app(self):
     """
     Warn if SESSION_COOKIE_HTTPONLY is off and "django.contrib.sessions"
     is in INSTALLED_APPS.
     """
     self.assertEqual(sessions.check_session_cookie_httponly(None),
                      [sessions.W013])
Beispiel #4
0
 def test_session_cookie_httponly_true(self):
     """
     If SESSION_COOKIE_HTTPONLY is on, there's no warning about it.
     """
     self.assertEqual(sessions.check_session_cookie_httponly(None), [])