def generate_user_instance(
        user_id=None,
        username="username",
        password=None,
        email=None,
        first_name="First Name",
        middle_name="Middle Name",
        last_name="Last Name",
        created=None,
        updated=None,
        is_active=True,
        is_readonly=False,
        is_admin=False
):
    """
    Returns:
        user_instance (User) - an not committed to DB instance of a User model.
    """
    # pylint: disable=too-many-arguments
    from app.modules.users.models import User
    if password is None:
        password = '%s_password' % username
    user_instance = User(
        id=user_id,
        username=username,
        first_name=first_name,
        middle_name=middle_name,
        last_name=last_name,
        password=password,
        email=email or '%s@email.com' % username,
        created=created or datetime.now(),
        updated=updated or datetime.now(),
        is_active=is_active,
        is_readonly=is_readonly,
        is_admin=is_admin,
    )
    user_instance.password_secret = password
    return user_instance
dataset/ETHPy150Open frol/flask-restplus-server-example/tests/utils.py/generate_user_instance/original