Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Parameters
----------
session : :class:`sqlalchemy.orm.Session`
The session to directly perform the operation on the database.
"""
add_user(
session, name='test_user', password='test',
lastname='Test', firstname='User',
email='test.user@gmail.com', access_level='asked')
approve_user(session, 'test_user')
add_user(
session, name='test_user_2', password='test',
lastname='Test_2', firstname='User_2',
email='test.user.2@gmail.com', access_level='user')
approve_user(session, 'test_user_2')
add_user(
session, name='test_iris_admin', password='test',
lastname='Admin', firstname='Iris',
email='iris.admin@gmail.com', access_level='admin')
def add_users(session):
"""Add dummy users in the database.
Parameters
----------
session : :class:`sqlalchemy.orm.Session`
The session to directly perform the operation on the database.
"""
add_user(
session, name='test_user', password='test',
lastname='Test', firstname='User',
email='test.user@gmail.com', access_level='asked')
approve_user(session, 'test_user')
add_user(
session, name='test_user_2', password='test',
lastname='Test_2', firstname='User_2',
email='test.user.2@gmail.com', access_level='user')
approve_user(session, 'test_user_2')
add_user(
session, name='test_iris_admin', password='test',
lastname='Admin', firstname='Iris',
email='iris.admin@gmail.com', access_level='admin')
def approve_user(config, login):
"""Approve a user which asked to sign-up to RAMP studio."""
config = read_config(config)
with session_scope(config['sqlalchemy']) as session:
user_module.approve_user(session, login)