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({})))
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({})))
def test_non_applicable(self): self.assertIsNone( handler.gae_cookie_authentication(webapp2.Request({})))
def test_non_applicable(self): self.assertIsNone(handler.gae_cookie_authentication(webapp2.Request({})))
def test_non_applicable(self): self.assertEqual( (None, None), handler.gae_cookie_authentication(webapp2.Request({})))