def setUp(self):
     """
         Setup of the testing environment. This function gets called every
         time a test method is run
     """
     database_uri = 'test_database.sqlite3'
     self.engine, self.metadata, self.Session = \
         init_db(db_connection_string="sqlite:///%s" % database_uri)
     self.session_instance = self.Session()
Exemple #2
0
def _init(connection_string, clear=False):
    eng, mdata, S = init_db(db_connection_string=connection_string)
    if clear:
        session = S()
        for i in session.query(Wall).all():
            session.delete(i)
        session.flush()
        session.commit()
    return S