def postgres_user(request): from fabtools.postgres import drop_user from fabtools.require.postgres import user name = 'pguser' user(name, password='******') request.addfinalizer(functools.partial(drop_user, name)) return name
def postgres_user(): from fabtools.postgres import drop_user from fabtools.require.postgres import user name = 'pguser' user(name, password='******') yield name drop_user(name)
def test_require_user(postgres_server): from fabtools.postgres import user_exists, drop_user from fabtools.require.postgres import user user('bob', password='******') assert user_exists('bob') drop_user('bob')
def _setup_database(): with settings(warn_only=True): postgres.server() postgres.user(env.psql_user, password=env.psql_password) postgres.database(env.psql_db, owner=env.psql_user)