diff --git a/pyxform/xls2json.py b/pyxform/xls2json.py index 2bac009f..f70164cd 100644 --- a/pyxform/xls2json.py +++ b/pyxform/xls2json.py @@ -841,11 +841,7 @@ def workbook_to_json( and question_type not in aliases.label_optional_types and not row.get("bind", {}).get("calculate") and not row.get("_dynamic_default", False) - and not ( - control_type is constants.GROUP - and row.get("control", {}).get("appearance") - == constants.FIELD_LIST - ) + and (control_type is not constants.GROUP) ): # Row number, name, and type probably enough for user message. # Also means the error message text is stable for tests. diff --git a/tests/test_group.py b/tests/test_group.py index afec55f2..45978af7 100644 --- a/tests/test_group.py +++ b/tests/test_group.py @@ -652,8 +652,14 @@ def test_unlabeled_group(self): | | text | my-text | my-text | | | end_group | | | """, - warnings_count=1, - warnings__contains=["[row : 2] Group has no label"], + warnings_count=0, + xml__xpath_match=[ + """ + /h:html/h:body/x:group[ + @ref = '/test_name/my-group' + ] + """ + ], ) def test_unlabeled_group_alternate_syntax(self): @@ -665,41 +671,16 @@ def test_unlabeled_group_alternate_syntax(self): | | text | my-text | my-text | | | end group | | | """, - warnings_count=1, - warnings__contains=["[row : 2] Group has no label"], - ) - - def test_unlabeled_group_fieldlist(self): - self.assertPyxformXform( - md=""" - | survey | - | | type | name | label | appearance | - | | begin_group | my-group | | field-list | - | | text | my-text | my-text | | - | | end_group | | | | - """, warnings_count=0, xml__xpath_match=[ """ /h:html/h:body/x:group[ - @ref = '/test_name/my-group' and @appearance='field-list' + @ref = '/test_name/my-group' ] """ ], ) - def test_unlabeled_group_fieldlist_alternate_syntax(self): - self.assertPyxformXform( - md=""" - | survey | - | | type | name | label::English (en) | appearance | - | | begin group | my-group | | field-list | - | | text | my-text | my-text | | - | | end group | | | | - """, - warnings_count=0, - ) - class TestGroupInternalRepresentations(TestCase): maxDiff = None diff --git a/tests/test_xlsform_spec.py b/tests/test_xlsform_spec.py index 891c591b..cbebed6a 100644 --- a/tests/test_xlsform_spec.py +++ b/tests/test_xlsform_spec.py @@ -68,8 +68,6 @@ def test_warnings__count(self): vc.INVALID_LABEL.format(row=6), vc.INVALID_LABEL.format(row=7), "[row : 9] Repeat has no label: {'name': 'repeat_test', 'type': 'begin repeat'}", - "[row : 10] Group has no label: {'name': 'group_test', 'type': 'begin group'}", - "[row : 17] Group has no label: {'name': 'name', 'type': 'begin group'}", "[row : 28] Use the max-pixels parameter to speed up submission " + "sending and save storage space. Learn more: https://xlsform.org/#image", ]