"""Test user fixture.""" import random from grass.models import oa_user, workstation_user def random_id(): """Create a random id. Returns: int: the random id. """ return int(1000 + 4000 * random.random()) def create_workstation_user(is_subaccount=True): """Create a random user. Args: subaccount (boolean): if the user needs to be a subaccount Returns: Response: the user that has been created. """ return workstation_user.create_workstation_user( id=random_id(), contact_id=random_id(), vendor_id=random_id(), subaccount_id=random_id() if is_subaccount else None, ) def create_oa_user(is_active=True): """Create a OA user. Args: is_active (bool): if the account is active. Return: Response: the user that has been created. """ return oa_user.create_oa_user(is_active=is_active, id=random_id())