def test_info_fields_rel_filtered_field(self):
        """
        REST Api: Test info fields with filtered
        related fields
        """
        client = self.app.test_client()
        token = self.login(client, USERNAME_ADMIN, PASSWORD_ADMIN)
        uri = "api/v1/model2apifilteredrelfields/_info"
        with model2_data(self.appbuilder.session, 4):
            # get the parent model
            parent_model = (
                self.appbuilder.session.query(Model1)
                .filter(Model1.field_integer == 3)
                .one_or_none()
            )
            rv = self.auth_client_get(client, token, uri)
            data = json.loads(rv.data.decode("utf-8"))
            expected_rel_add_field = {
                "description": "",
                "label": "Group",
                "name": "group",
                "required": True,
                "unique": False,
                "type": "Related",
                "count": 1,
                "values": [{"id": parent_model.id, "value": "test3"}],
            }
            for rel_field in data[API_ADD_COLUMNS_RES_KEY]:
                if rel_field["name"] == "group":
                    self.assertEqual(rel_field, expected_rel_add_field)
            for rel_field in data[API_EDIT_COLUMNS_RES_KEY]:
                if rel_field["name"] == "group":
                    self.assertEqual(rel_field, expected_rel_add_field)

        REST Api: Test info fields with filtered
        related fields
        
tests/test_api.py