def DBSession(request, app): """ Aquire DBSession from WebTest App The WSGI app has already been started, we can import the session safly knowing it has been setup """ from karakara.model import DBSession from karakara.model.init_data import init_data init_data() return DBSession
def app(request, settings): from webtest import TestApp from karakara import main as karakara_main #print('setup WebApp') app = TestApp(karakara_main({}, **settings)) from karakara.model.init_data import init_data init_data() def finalizer(): #print('tearDown WebApp') pass request.addfinalizer(finalizer) return app
def app(request, app_ini): """ Start KaraKara application """ from webtest import TestApp from karakara import main as karakara_main #print('setup WebApp') app = TestApp(karakara_main({}, **app_ini)) from karakara.model.init_data import init_data init_data() def finalizer(): #print('tearDown WebApp') pass request.addfinalizer(finalizer) return app
def DBSession(request, DBSession_base): from karakara.model.init_data import init_data init_data() return DBSession_base