예제 #1
0
파일: conftest.py 프로젝트: uh2k/KaraKara
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
예제 #2
0
파일: conftest.py 프로젝트: shish/KaraKara
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
예제 #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
예제 #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
예제 #5
0
def DBSession(request, DBSession_base):
    from karakara.model.init_data import init_data
    init_data()
    return DBSession_base