diff --git a/tests/unit/test_config_schemas_and_ai_endpoints.py b/tests/unit/test_config_schemas_and_ai_endpoints.py index 22671825a..bbb5825ad 100644 --- a/tests/unit/test_config_schemas_and_ai_endpoints.py +++ b/tests/unit/test_config_schemas_and_ai_endpoints.py @@ -105,11 +105,19 @@ class TestNormalizePlanConfig: class TestNormalizeTemplateConfig: - def test_same_as_plan_config(self): + def test_same_as_plan_config_plus_template_fields(self): + """template config 包含 plan config 的所有字段,外加 transition_enabled""" from packages.domain.config_schemas import normalize_plan_config, normalize_template_config raw = {"title": {"text": "模板标题"}} - assert normalize_template_config(raw) == normalize_plan_config(raw) + plan_cfg = normalize_plan_config(raw) + tpl_cfg = normalize_template_config(raw) + # plan config 的字段在 template config 中应一致 + for key in plan_cfg: + assert tpl_cfg[key] == plan_cfg[key] + # template config 额外包含 transition_enabled + assert "transition_enabled" in tpl_cfg + assert tpl_cfg["transition_enabled"] is True def test_none_returns_defaults(self): from packages.domain.config_schemas import DEFAULT_EDIT_TEMPLATE_CONFIG, normalize_template_config diff --git a/tests/unit/test_edit_templates_api.py b/tests/unit/test_edit_templates_api.py index 1537ab73b..a50e60afa 100644 --- a/tests/unit/test_edit_templates_api.py +++ b/tests/unit/test_edit_templates_api.py @@ -407,6 +407,7 @@ class TestResponseSchema: "name", "description", "template_type", + "editing_mode", "config", "preview_url", "sort_weight",