Exemplo n.º 1
0
def load_fixtures():
    session_manager.create_session()

    _load_users_fixtures()

    session_manager.commit_session()
    session_manager.close_session()
Exemplo n.º 2
0
def load_fixtures():
    session_manager.create_session()

    _load_users_fixtures()

    _create_stocks_with_data()

    session_manager.commit_session()
    session_manager.close_session()
Exemplo n.º 3
0
def create_session_and_trunc_tables(request):
    session_manager.create_session()
    trunc_all_tables()

    def end_session():
        session_manager.commit_session()
        session_manager.close_session()

    request.addfinalizer(end_session)
Exemplo n.º 4
0
    def wrapper(request, *args, **kwargs):
        session_manager.create_session()
        try:
            response = func(request, *args, **kwargs)
            session_manager.commit_session()
        except:
            session_manager.rollback_session()
            raise
        finally:
            session_manager.close_session()

        return response