Skip to content

Commit

Permalink
fix: allow headers to be capitalized
Browse files Browse the repository at this point in the history
  • Loading branch information
rgraber committed Jan 30, 2025
1 parent cc9aaf6 commit cb00206
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/formpack/utils/expand_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _mark_special(**kwargs: str) -> None:
_pluck_uniq_cols('choices')

for column_name in uniq_cols.keys():
if column_name in ['label', 'hint']:
if column_name.lower() in ['label', 'hint']:
_mark_special(
column_name=column_name,
column=column_name,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_expand_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,5 +604,11 @@ def test_expand_translations_null_lang():
assert s1 == s1_copy


def test_expand_ignores_case():
s1 = {'survey': [{'type': 'text', 'Label': 'hi'}]}
expand_content(s1, in_place=True)
assert s1.get('translated') == ['Label']


def _s(rows):
return {'survey': [dict([[key, 'x']]) for key in rows]}

0 comments on commit cb00206

Please sign in to comment.