def METHOD_NAME(self, registry_testblok_func):
    """Test the attribute based policy, in conjunction with the model one.
    The policy is defined in the ``attr_authz`` blok
    The supporting default model is installed by the same blok.
    TODO move this test to the 'attr_authz' blok, or put the policy in the
    main code body.
    """
    registry = registry_testblok_func
    registry.upgrade(install=("test-blok10",))
    model = registry.Test2
    Grant = registry.Authorization.ModelPermissionGrant
    Grant.insert(model="Model.Test2", principal="Franck", permission="Read")
    Grant.insert(
        model="Model.Test2", principal="Georges", permission="Read"
    )
    # We also test that this entry is ignored, because it is
    # superseded by attribute-based policy
    Grant.insert(model="Model.Test", principal="Franck", permission="Write")
    record = model.insert(id=1, owner="Georges")
    assert registry.check_permission(record, ("Franck",), "Read")
    assert registry.check_permission(record, ("Georges",), "Write")
    assert not registry.check_permission(record, ("Franck",), "Write")
    # The same checks can be done from the record
    assert record.has_perm(("Franck",), "Read")
    assert record.has_perm(("Georges",), "Write")
    assert not record.has_perm(("Franck",), "Write")
    # With this policy, permission cannot be checked on the model
    with pytest.raises(RuleNotForModelClasses):
        registry.check_permission(model, ("Franck",), "Write")
    # ... unless one defines a model_rule to handle the case
    assert not registry.check_permission(
        model, ("Franck",), "PermWithModelRule"
    )
    Grant = registry.Authorization.ModelPermissionGrant
    Grant.insert(
        model=model.__registry_name__,
        principal="Franck",
        permission="PermWithModelRule",
    )
    assert registry.check_permission(
        model, ("Franck",), "PermWithModelRule"
    )
    assert not record.has_perm(("Franck",), "PermWithModelRule")
    # Query wrapping tests
    model.insert(id=2, owner="Franck")
    model.insert(id=3, owner="JS")
    query = model.query()
    assert query.count() == 3
    filtered = registry.wrap_query_permission(query, ("Franck",), "Write")
    assert filtered.count() == 1
    assert filtered.first().id == 2
    all_results = filtered.all()
    assert all_results[0].id == 2
    # The same can be achieved directly on query
    filtered = query.with_perm(("Franck",), "Write")
    assert filtered.count() == 1
    assert filtered.first().id == 2
    all_results = filtered.all()
    assert all_results[0].id == 2
    filtered = registry.wrap_query_permission(query, ("Franck",), "Read")
    print(filtered.query.sql_statement)
    assert filtered.count() == 3
    filtered = registry.wrap_query_permission(
        query,
        (
            "Franck",
            "Georges",
        ),
        "Write",
    )
    assert filtered.count() == 2
    assert filtered.all().id == [1, 2]