Esempio n. 1
0
def _initTestingDB():
    from c3sar.models import DBSession
    from c3sar.models import Base
    from sqlalchemy import create_engine
    engine = create_engine('sqlite://')
    session = DBSession()
    session.configure(bind=engine)
    Base.metadata.bind = engine
    Base.metadata.create_all(engine)
Esempio n. 2
0
def _initTestingDB():
    from sqlalchemy import create_engine
    from c3sar.models import DBSession
    from c3sar.models import Base
    from c3sar.models import initialize_sql
    engine = create_engine('sqlite:///:memory:')
#    session = initialize_sql(create_engine('sqlite://'))
    DBSession.configure(bind=engine)
    Base.metadata.bind = engine
    Base.metadata.create_all(engine)
    return DBSession