Exemplo n.º 1
0
 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     models.Base.metadata.create_all(self.engine)
     self.engine.connect()
     objects.load()
Exemplo n.º 2
0
Arquivo: utils.py Projeto: alex/solum
 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.upgrade()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     self.engine.connect()
     objects.load()
Exemplo n.º 3
0
 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.upgrade()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     self.engine.connect()
     objects.load()
Exemplo n.º 4
0
 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     models.Base.metadata.create_all(self.engine)
     self.engine.connect()
     objects.load()
Exemplo n.º 5
0
def reset_dummy_db():
    engine = get_engine()
    meta = sqlalchemy.MetaData()
    meta.reflect(bind=engine)

    for table in reversed(meta.sorted_tables):
        if table.name == 'migrate_version':
            continue
        engine.execute(table.delete())
Exemplo n.º 6
0
def reset_dummy_db():
    engine = get_engine()
    meta = sqlalchemy.MetaData()
    meta.reflect(bind=engine)

    for table in reversed(meta.sorted_tables):
        if table.name == 'migrate_version':
            continue
        engine.execute(table.delete())
Exemplo n.º 7
0
 def __init__(self):
     super(Database, self).__init__()
     self.db_file = None
     with tempfile.NamedTemporaryFile(suffix='.sqlite',
                                      delete=False) as test_file:
         # note the temp file gets deleted by the NestedTempfile fixture.
         self.db_file = test_file.name
     self.engine = session.get_engine()
     # make sure the current connection is cleaned up.
     self.engine.dispose()
     session.cleanup()
Exemplo n.º 8
0
 def __init__(self):
     super(Database, self).__init__()
     self.db_file = None
     with tempfile.NamedTemporaryFile(suffix='.sqlite',
                                      delete=False) as test_file:
         # note the temp file gets deleted by the NestedTempfile fixture.
         self.db_file = test_file.name
     self.engine = session.get_engine()
     # make sure the current connection is cleaned up.
     self.engine.dispose()
     session.cleanup()
Exemplo n.º 9
0
def setup_dummy_db():
    engine = get_engine()
    engine.connect()
Exemplo n.º 10
0
 def version(self):
     engine = db_session.get_engine()
     with engine.connect() as conn:
         context = alembic_migration.MigrationContext.configure(conn)
         return context.get_current_revision()
Exemplo n.º 11
0
 def version(self):
     engine = db_session.get_engine()
     with engine.connect() as conn:
         context = alembic_migration.MigrationContext.configure(conn)
         return context.get_current_revision()
Exemplo n.º 12
0
def setup_dummy_db():
    engine = get_engine()
    engine.connect()