def test__get_joinedload_object_for_splitted_include__wrong_field_name( self, permission_user): qs = QueryStringManager({}, ModelWithMeta) with pytest.raises(InvalidInclude): PermissionPlugin._get_joinedload_object_for_splitted_include( 'wrong_field', qs, permission_user, ModelWithMetaSchema(), ModelWithMeta)
def test__get_joinedload_object_for_splitted_include__not_allowed( self, mock_is_access_foreign_key, permission_user): qs = QueryStringManager({}, ModelWithMeta) result = PermissionPlugin._get_joinedload_object_for_splitted_include( 'related_model_id', qs, permission_user, ModelWithMetaSchema(), ModelWithMeta) assert result is None