コード例 #1
0
def registry_contextual_model_many2one(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"],
                                        funct_contextual_model_many2one,
                                        multipk=request.param)
    request.addfinalizer(registry.close)
    return registry
コード例 #2
0
def registry_contextual_default_model(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"],
                                        funct_contextual_model,
                                        ColumnType=request.param[0],
                                        **request.param[1])
    request.addfinalizer(registry.close)
    return registry
コード例 #3
0
def registry_core_view(request, bloks_loaded):
    reset_db()
    registry = init_registry_with_bloks(['furetui'], simple_view)
    request.addfinalizer(registry.close)
    registry.T1.insert(code='test1', val=1)
    registry.T2.insert(code='test1', val=2)
    registry.T1.insert(code='test2', val=3)
    registry.T2.insert(code='test2', val=4)
    return registry
コード例 #4
0
def registry_contextual_model(request, bloks_loaded,
                              column_definition):  # noqa F811
    reset_db()
    column, value1, value2, value3, kwargs = column_definition
    registry = init_registry_with_bloks(["furetui"],
                                        funct_contextual_model,
                                        ColumnType=column,
                                        **kwargs)
    request.addfinalizer(registry.close)
    return registry
コード例 #5
0
def registry_context_with_furetui(request, webserver,
                                  bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"], add_context_with_furetui)
    registry.Test.insert(code='test')
    webserver.post_json('/furet-ui/login', {
        'login': '******',
        'password': '******'
    },
                        status=200)

    def logout():
        webserver.post_json('/furet-ui/logout', status=200)
        registry.close()

    request.addfinalizer(logout)
    return registry
コード例 #6
0
def registry_call_method(request, webserver, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui", "furetui-auth"],
                                        _with_call_method, **request.param)
    registry.Pyramid.User.insert(login='******')
    registry.Pyramid.CredentialStore.insert(login='******', password='******')
    webserver.post_json('/furet-ui/login', {
        'login': '******',
        'password': '******'
    },
                        status=200)

    def logout():
        webserver.post_json('/furet-ui/logout', status=200)
        registry.close()

    request.addfinalizer(logout)
    return registry
コード例 #7
0
def registry_context_with_furetui_and_auth(request, webserver, bloks_loaded):
    reset_db()
    registry = init_registry_with_bloks(["furetui", "furetui-auth"],
                                        add_context)
    registry.Pyramid.User.insert(login='******', lang=request.param)
    registry.Pyramid.CredentialStore.insert(login='******', password='******')
    registry.Test.insert(code='test')
    webserver.post_json('/furet-ui/login', {
        'login': '******',
        'password': '******'
    },
                        status=200)

    def logout():
        webserver.post_json('/furet-ui/logout', status=200)
        registry.close()

    request.addfinalizer(logout)
    return registry
コード例 #8
0
def registry_one2many(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"], request.param)
    request.addfinalizer(registry.close)
    return registry
コード例 #9
0
def registry_simple_model(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"], simple_model)
    request.addfinalizer(registry.close)
    return registry
コード例 #10
0
def registry_contextual_model_fallback(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"],
                                        funct_contextual_model_fallback)
    request.addfinalizer(registry.close)
    return registry
コード例 #11
0
def registry_core(request, bloks_loaded):  # noqa F811
    reset_db()
    registry = init_registry_with_bloks(["furetui"], request.param['funct'])
    request.addfinalizer(registry.close)
    return registry, request.param