Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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
Beispiel #5
0
def DBSession(request, DBSession_base):
    from karakara.model.init_data import init_data
    init_data()
    return DBSession_base