Esempio n. 1
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    user = user_service.create('user', 'test', '*****@*****.**', True, None, [])
    admin_role = role_service.create('admin')
    admin = user_service.create('admin', 'admin', '*****@*****.**', True, None, [admin_role])
    _db.session.commit()
    yield _db
Esempio n. 2
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    UserFactory()
    r = RoleFactory(name='admin')
    UserFactory(roles=[r])

    _db.session.commit()
    yield _db
Esempio n. 3
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    UserFactory()
    r = RoleFactory(name='admin')
    UserFactory(roles=[r])

    _db.session.commit()
    yield _db
    _db.drop_all()
Esempio n. 4
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    user = user_service.create('user', 'test', '*****@*****.**', True, None,
                               [])
    admin_role = role_service.create('admin')
    admin = user_service.create('admin', 'admin', '*****@*****.**', True,
                                None, [admin_role])
    _db.session.commit()
    yield _db
Esempio n. 5
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    UserFactory()
    r = RoleFactory(name='admin')
    UserFactory(roles=[r])
    rp = RotationPolicyFactory(name='default')

    _db.session.commit()
    yield _db
    _db.drop_all()
Esempio n. 6
0
def db(app, request):
    _db.drop_all()
    _db.create_all()

    _db.app = app

    UserFactory()
    r = RoleFactory(name='admin')
    u = UserFactory(roles=[r])
    rp = RotationPolicyFactory(name='default')
    ApiKeyFactory(user=u)

    _db.session.commit()
    yield _db
    _db.drop_all()
Esempio n. 7
0
def db(app, request):
    _db.drop_all()
    _db.engine.execute(text("CREATE EXTENSION IF NOT EXISTS pg_trgm"))
    _db.create_all()

    _db.app = app

    UserFactory()
    r = RoleFactory(name="admin")
    u = UserFactory(roles=[r])
    rp = RotationPolicyFactory(name="default")
    ApiKeyFactory(user=u)

    _db.session.commit()
    yield _db
    _db.drop_all()