Esempio n. 1
0
 def _load_profile_class(self, provider):
     try:
         pkey = 'aeauth.strategies.{}'.format(provider)
         profile_path = Config.get(pkey).user_profile_model
         profile_class = utils.import_class(profile_path)
     except AttributeError, e:
         raise AttributeError("You must provide the location of "\
                              "the {0} user profile.".format(provider))
Esempio n. 2
0
 def _get_user_model(self):
     try:
         return utils.import_class(self._config.user_model)
     except ImportError, e:
         raise Exception('The following error occurred while attempting to '\
                         'import your custom user model: {}'.format(e))
Esempio n. 3
0
 def test_import_class(self):
     klass = utils.import_class('utils_test.TestImportStringClass')
     self.assertEqual(klass, TestImportStringClass)