Пример #1
0
def regular_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(
            email='test@localhost',
        )
    ):
        yield _
Пример #2
0
def admin_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(
            email='admin@localhost', is_active=True, is_admin=True
        )
    ):
        yield _
Пример #3
0
def internal_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******',
                                         is_regular_user=False,
                                         is_admin=False,
                                         is_active=True,
                                         is_internal=True)):
        yield _
Пример #4
0
def internal_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(
            email='internal@localhost',
            is_internal=True,
        )
    ):
        yield _
Пример #5
0
def internal_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(
            email='internal@localhost',
            is_staff=False,
            is_admin=False,
            is_active=True,
            is_internal=True,
        )
    ):
        yield _
def internal_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(
                username='******',
                is_regular_user=False,
                is_admin=False,
                is_active=True,
                is_internal=True
            )
        ):
        yield _
Пример #7
0
def readonly_user(db):
    readonly_user_instance = utils.generate_user_instance(
        username='******', is_regular_user=False)

    with db.session.begin():
        db.session.add(readonly_user_instance)

    yield readonly_user_instance

    with db.session.begin():
        db.session.delete(readonly_user_instance)
Пример #8
0
def admin_user(db):
    admin_user_instance = utils.generate_user_instance(username='******',
                                                       is_admin=True)

    with db.session.begin():
        db.session.add(admin_user_instance)

    yield admin_user_instance

    with db.session.begin():
        db.session.delete(admin_user_instance)
Пример #9
0
def regular_user(flask_app):
    # pylint: disable=invalid-name,unused-argument,no-member
    from app.extensions import db

    regular_user_instance = utils.generate_user_instance(
        username='******')

    db.session.add(regular_user_instance)
    db.session.commit()
    yield regular_user_instance
    db.session.delete(regular_user_instance)
    db.session.commit()
Пример #10
0
def readonly_user(flask_app):
    # pylint: disable=invalid-name,unused-argument
    from app.extensions import db

    readonly_user_instance = utils.generate_user_instance(
        username='******', is_readonly=True)

    db.session.add(readonly_user_instance)
    db.session.commit()
    yield readonly_user_instance
    db.session.delete(readonly_user_instance)
    db.session.commit()
Пример #11
0
def admin_user(flask_app):
    # pylint: disable=invalid-name,unused-argument
    from app.extensions import db

    admin_user_instance = utils.generate_user_instance(username='******',
                                                       is_admin=True)

    db.session.add(admin_user_instance)
    db.session.commit()
    yield admin_user_instance
    db.session.delete(admin_user_instance)
    db.session.commit()
def regular_user(flask_app):
    # pylint: disable=invalid-name,unused-argument,no-member
    from app.extensions import db

    regular_user_instance = utils.generate_user_instance(
        username='******'
    )

    db.session.add(regular_user_instance)
    db.session.commit()
    yield regular_user_instance
    db.session.delete(regular_user_instance)
    db.session.commit()
def readonly_user(flask_app):
    # pylint: disable=invalid-name,unused-argument
    from app.extensions import db

    readonly_user_instance = utils.generate_user_instance(
        username='******',
        is_readonly=True
    )

    db.session.add(readonly_user_instance)
    db.session.commit()
    yield readonly_user_instance
    db.session.delete(readonly_user_instance)
    db.session.commit()
def admin_user(flask_app):
    # pylint: disable=invalid-name,unused-argument,no-member
    from app.extensions import db

    admin_user_instance = utils.generate_user_instance(
        username='******',
        is_admin=True
    )

    db.session.add(admin_user_instance)
    db.session.commit()
    yield admin_user_instance
    db.session.delete(admin_user_instance)
    db.session.commit()
Пример #15
0
def internal_user(db):
    internal_user_instance = utils.generate_user_instance(
        username='******',
        is_regular_user=False,
        is_admin=False,
        is_active=True,
        is_internal=True)

    with db.session.begin():
        db.session.add(internal_user_instance)

    yield internal_user_instance

    with db.session.begin():
        db.session.delete(internal_user_instance)
Пример #16
0
def internal_user(flask_app):
    # pylint: disable=invalid-name,unused-argument
    from app.extensions import db

    internal_user_instance = utils.generate_user_instance(
        username='******',
        is_regular_user=False,
        is_admin=False,
        is_active=True,
        is_internal=True)

    db.session.add(internal_user_instance)
    db.session.commit()
    yield internal_user_instance
    db.session.delete(internal_user_instance)
    db.session.commit()
Пример #17
0
def internal_user(flask_app):
    # pylint: disable=invalid-name,unused-argument
    from app.extensions import db

    internal_user_instance = utils.generate_user_instance(
        username='******',
        is_regular_user=False,
        is_admin=False,
        is_active=True,
        is_internal=True
    )

    db.session.add(internal_user_instance)
    db.session.commit()
    yield internal_user_instance
    db.session.delete(internal_user_instance)
    db.session.commit()
Пример #18
0
def user_instance(patch_User_password_scheme):
    # pylint: disable=unused-argument,invalid-name
    user_id = 1
    _user_instance = utils.generate_user_instance(user_id=user_id)
    _user_instance.get_id = lambda: user_id
    return _user_instance
Пример #19
0
def temp_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(email='temp@localhost', full_name='Temp User')
    ):
        yield _
Пример #20
0
def user_instance(patch_User_password_scheme):
    user_id = 1
    _user_instance = utils.generate_user_instance(user_id=user_id)
    _user_instance.get_id = lambda: user_id
    return _user_instance
def regular_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******')
        ):
        yield _
def readonly_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******', is_regular_user=False)
        ):
        yield _
def admin_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******', is_admin=True)
        ):
        yield _
def user_instance(patch_User_password_scheme):
    # pylint: disable=unused-argument,invalid-name
    user_id = 1
    _user_instance = utils.generate_user_instance(user_id=user_id)
    _user_instance.get_id = lambda: user_id
    return _user_instance
def user_instance(patch_User_password_scheme):
    user_id = 1
    _user_instance = utils.generate_user_instance(user_id=user_id)
    _user_instance.get_id = lambda: user_id
    return _user_instance
Пример #26
0
def readonly_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
        utils.generate_user_instance(email='readonly@localhost')
    ):
        yield _
Пример #27
0
def admin_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******',
                                         is_admin=True)):
        yield _
Пример #28
0
def readonly_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******',
                                         is_regular_user=False)):
        yield _
Пример #29
0
def user_instance(patch_User_password_scheme):
    # pylint: disable=unused-argument,invalid-name
    _user_instance = utils.generate_user_instance()
    return _user_instance
Пример #30
0
def regular_user(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username='******')):
        yield _
Пример #31
0
def user3(temp_db_instance_helper):
    for _ in temp_db_instance_helper(
            utils.generate_user_instance(username="******")):
        yield _