Пример #1
0
def reset_search_index(session):
    """Recreate index and fill index.
    """
    initializees.drop_index()
    initializees.setup_es()
    fill_index(session)
    force_search_index()
Пример #2
0
def setup_package():
    # set up database
    engine = get_engine()
    DBSession.configure(bind=engine)
    Base.metadata.drop_all(engine)
    initializedb.setup_db(engine, DBSession)
    # Add test data needed for all tests
    with transaction.manager:
        _add_global_test_data(DBSession)
    DBSession.remove()
    # set up ElasticSearch
    configure_es_from_config(settings)
    initializees.drop_index()
    initializees.setup_es()
Пример #3
0
def setup_package():
    # set up database
    engine = get_engine()
    DBSession.configure(bind=engine)
    Base.metadata.drop_all(engine)
    initializedb.setup_db(engine, DBSession)

    # set up ElasticSearch
    configure_es_from_config(settings)
    initializees.drop_index()
    initializees.setup_es()

    # Add test data needed for all tests
    with transaction.manager:
        _add_global_test_data(DBSession)
        fill_index(DBSession)
    DBSession.remove()
Пример #4
0
def setup_package():
    # set up database
    engine = get_engine()
    DBSession.configure(bind=engine)

    alembic_config = _get_alembic_config()
    downgrade(alembic_config, 'base')
    initializedb.setup_db(alembic_config, DBSession)

    # set up ElasticSearch
    configure_es_from_config(settings)
    initializees.drop_index()
    initializees.setup_es()

    # Add test data needed for all tests
    with transaction.manager:
        _add_global_test_data(DBSession)
        fill_index(DBSession)
    DBSession.remove()
Пример #5
0
def teardown_package():
    # tear down database
    if not keep:
        alembic_config = _get_alembic_config()
        downgrade(alembic_config, 'base')
        initializees.drop_index()
Пример #6
0
def teardown_package():
    # tear down database
    engine = get_engine()
    if not keep:
        Base.metadata.drop_all(engine)
        initializees.drop_index()
Пример #7
0
def teardown_package():
    # tear down database
    if not keep:
        alembic_config = _get_alembic_config()
        downgrade(alembic_config, 'base')
        initializees.drop_index()