def test_info_fields_rel_field(self):
        """
        REST Api: Test info fields with related fields
        """
        client = self.app.test_client()
        token = self.login(client, USERNAME_ADMIN, PASSWORD_ADMIN)

        uri = "api/v1/model2api/_info"
        with model2_data(self.appbuilder.session, MODEL2_DATA_SIZE) as models:
            rv = self.auth_client_get(client, token, uri)
            data = json.loads(rv.data.decode("utf-8"))
            expected_rel_add_field = {
                "count": MODEL2_DATA_SIZE,
                "description": "",
                "label": "Group",
                "name": "group",
                "required": True,
                "unique": False,
                "type": "Related",
                "values": [
                    {"id": model.group_id, "value": f"test{i}"}
                    for i, model in enumerate(models)
                    if i < self.model2api.page_size
                ],
            }
            for rel_field in data[API_ADD_COLUMNS_RES_KEY]:
                if rel_field["name"] == "group":
                    self.assertEqual(rel_field, expected_rel_add_field)

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