def setUp(self): super(TestListUsers, self).setUp() user_api.add_user( self.user_object, email='*****@*****.**', password='******' )
def _setup_user_table(user_session): """Initialize user table with default user.""" logging.info('setup user table') from compass.db.api import user user.add_user( session=user_session, email=setting.COMPASS_ADMIN_EMAIL, password=setting.COMPASS_ADMIN_PASSWORD, is_admin=True )
def test_not_admin(self): user_api.add_user(user=self.user_object, email='*****@*****.**', password='******', is_admin=False) user_object = user_api.get_user_object('*****@*****.**') self.assertRaises(exception.Forbidden, user_api.update_user, 2, user=user_object, is_admin=False)
def test_not_admin(self): user_api.add_user( user=self.user_object, email='*****@*****.**', password='******', is_admin=False ) user_object = user_api.get_user_object('*****@*****.**') self.assertRaises( exception.Forbidden, user_api.update_user, 2, user=user_object, is_admin=False )
def test_add_user(self): user_objs = user_api.add_user( self.user_object, email='*****@*****.**', password='******' ) self.assertEqual('*****@*****.**', user_objs['email'])
def add_user(): """add user.""" data = _get_request_data() user_dict = user_api.add_user(current_user, **data) return utils.make_json_response( 200, user_dict )
def test_add_user_session(self): with database.session() as session: user_objs = user_api.add_user(email='*****@*****.**', password='******', user=self.user_object, session=session) self.assertEqual('*****@*****.**', user_objs['email'])
def test_add_user(self): user_objs = user_api.add_user( email='*****@*****.**', password='******', user=self.user_object, ) self.assertEqual('*****@*****.**', user_objs['email'])
def test_add_user_session(self): with database.session() as session: user_objs = user_api.add_user( email='*****@*****.**', password='******', user=self.user_object, session=session ) self.assertEqual('*****@*****.**', user_objs['email'])
def setUp(self): super(TestListUsers, self).setUp() user_api.add_user(user=self.user_object, email='*****@*****.**', password='******')