Ejemplo n.º 1
0
 def test_strict_is_string(self):
     user_class = "tests.fixture.sa_model:User"
     dbsession = "tests.fixture.sa_model:DBSession"
     # Strict == True
     strict = "True"
     mdprovider = make_sa_user_mdprovider(user_class, dbsession, strict=strict)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyStrictUserMDPlugin))
     # Strict == False
     strict = "False"
     mdprovider = make_sa_user_mdprovider(user_class, dbsession, strict=strict)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyUserMDPlugin))
Ejemplo n.º 2
0
 def test_username_translation(self):
     user_class = "tests.fixture.sa_model:User"
     dbsession = "tests.fixture.sa_model:DBSession"
     username_translation = "username"
     mdprovider = make_sa_user_mdprovider(user_class, dbsession, username_translation)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyUserMDPlugin))
     self.assertEqual(username_translation, mdprovider.translations["user_name"])
Ejemplo n.º 3
0
 def test_username_translation(self):
     user_class = 'tests.fixture.sa_model:User'
     dbsession = 'tests.fixture.sa_model:DBSession'
     username_translation = 'username'
     mdprovider = make_sa_user_mdprovider(user_class, dbsession,
                                          username_translation)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyUserMDPlugin))
     self.assertEqual(username_translation,
                      mdprovider.translations['user_name'])
Ejemplo n.º 4
0
 def test_simple_call(self):
     user_class = 'tests.fixture.sa_model:User'
     dbsession = 'tests.fixture.sa_model:DBSession'
     mdprovider = make_sa_user_mdprovider(user_class, dbsession)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyUserMDPlugin))
Ejemplo n.º 5
0
 def test_strict_user_md(self):
     user_class = "tests.fixture.sa_model:User"
     dbsession = "tests.fixture.sa_model:DBSession"
     mdprovider = make_sa_user_mdprovider(user_class, dbsession, strict=True)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyStrictUserMDPlugin))
Ejemplo n.º 6
0
 def test_simple_call(self):
     user_class = 'tests.fixture.sa_model:User'
     dbsession = 'tests.fixture.sa_model:DBSession'
     mdprovider = make_sa_user_mdprovider(user_class, dbsession)
     self.assertTrue(isinstance(mdprovider, SQLAlchemyUserMDPlugin))