コード例 #1
0
 def get_session(self):
     # NOTE: this isn't like a real session,
     # the class gets created fresh for every single
     # test so there is no point in caching the session
     # creator properly.
     #self.helper.setup_clean_db()
     cs = self.helper.config.sqlalchemy_connection_string()
     engine = create_engine(cs)
     metadata.bind = engine
     metadata.create_all()
     Session = sessionmaker(bind=engine)
     self.session = Session()
     return self.session
コード例 #2
0
 def test_schema(self):
     cs = self.helper.config.sqlalchemy_connection_string()
     engine = create_engine(cs)
     metadata.bind = engine
     metadata.create_all()