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): from example.model import User, Session registry = self.config.registry registry.registerUtility(TestSerializer(), ISerializer) self.app session = Session() session.add(User(id=1, name='Bob')) session.commit()
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')