def test_get_summary_for_section(section_with_custom_summary): schema = QuestionnaireSchema(section_with_custom_summary) section_summary = schema.get_summary_for_section("section") expected_keys = { "type", "for_list", "title", "add_link_text", "empty_list_text", "item_title", } assert len(section_summary["items"]) == 1 assert set(section_summary["items"][0].keys()) == expected_keys
def test_get_summary_for_section_does_not_exist(section_with_custom_summary): del section_with_custom_summary["sections"][0]["summary"] schema = QuestionnaireSchema(section_with_custom_summary) assert not schema.get_summary_for_section("section")