コード例 #1
0
 def test_get_backend(self):
   backends = load_backends(('penelophant.auth.backends.PasswordAuth.PasswordAuth',))
   from penelophant.auth.backends.PasswordAuth import PasswordAuth
   self.assertEqual(get_backend(PasswordAuth.provider), PasswordAuth)
コード例 #2
0
def register_auth_backends():
  """ Register auth backends from config """
  load_backends(app.config['AUTH_BACKENDS'])
コード例 #3
0
 def test_load_backends(self):
   backends = load_backends(('penelophant.auth.backends.PasswordAuth.PasswordAuth',))
   self.assertEqual(len(backends), 1)
   from penelophant.auth.backends.PasswordAuth import PasswordAuth
   self.assertEqual(backends[PasswordAuth.provider], PasswordAuth)