예제 #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)