Ejemplo n.º 1
0
 def test_applicable(self):
     os.environ.update({
         'USER_EMAIL': '*****@*****.**',
         'USER_ID': '123',
         'USER_IS_ADMIN': '0',
     })
     # Actual request is not used by CookieAuthentication.
     self.assertEqual(
         model.Identity(model.IDENTITY_USER, '*****@*****.**'),
         handler.gae_cookie_authentication(webapp2.Request({})))
Ejemplo n.º 2
0
 def test_applicable(self):
   os.environ.update({
     'USER_EMAIL': '*****@*****.**',
     'USER_ID': '123',
     'USER_IS_ADMIN': '0',
   })
   # Actual request is not used by CookieAuthentication.
   self.assertEqual(
       model.Identity(model.IDENTITY_USER, '*****@*****.**'),
       handler.gae_cookie_authentication(webapp2.Request({})))
Ejemplo n.º 3
0
 def test_applicable_admin(self):
     os.environ.update({
         'USER_EMAIL': '*****@*****.**',
         'USER_ID': '123',
         'USER_IS_ADMIN': '1',
     })
     # Actual request is not used by CookieAuthentication.
     self.assertEqual((
         model.Identity(model.IDENTITY_USER, '*****@*****.**'),
         api.new_auth_details(is_superuser=True),
     ), handler.gae_cookie_authentication(webapp2.Request({})))
Ejemplo n.º 4
0
 def test_non_applicable(self):
     self.assertIsNone(
         handler.gae_cookie_authentication(webapp2.Request({})))
Ejemplo n.º 5
0
 def test_non_applicable(self):
   self.assertIsNone(handler.gae_cookie_authentication(webapp2.Request({})))
Ejemplo n.º 6
0
 def test_non_applicable(self):
     self.assertEqual(
         (None, None),
         handler.gae_cookie_authentication(webapp2.Request({})))