def _modify_user(self): from example.model import User, Session session = Session() user = session.query(User).get(1) user.name = 'Bob Marley' session.commit() session.close()
def setUp(self): os.environ['CACHING_ENABLED'] = 'false' # creating app to setup cache and decorate stuff. self.app from example.model import User, Session session = Session() session.add(User(id=1, name='Bob')) session.commit()
def setUp(self): # creating app to setup cache and decorate stuff. self.app from example.model import User, Session session = Session() session.add(User(id=1, name='Bob')) session.commit() session.close() self.cache_client.client.delete('cache')
def sqla_session(self): from example.model import Session session = Session() self.addCleanup(session.close) self.addCleanup(delattr, self, 'sqla_session') return session