Skip to content

Commit 33480bd

Browse files
chg: move test_xlsform_headers.py tests into test_sheet_columns.py
- these test modules are about the same topic
1 parent 446d6d4 commit 33480bd

2 files changed

Lines changed: 56 additions & 63 deletions

File tree

tests/test_sheet_columns.py

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ def test_case_insensitive_form_id_form_title(self):
4545
xml__xpath_match=[xps.form_title("Welcome!"), xps.form_id("My Form")],
4646
)
4747

48+
def test_form_id_variant(self):
49+
md = """
50+
| survey | | | |
51+
| | type | name | label |
52+
| | text | member_name | name |
53+
| settings | | | |
54+
| | id_string | version | form_id |
55+
| | get_option_from_two_repeat_answer | vWvvk3GYzjXcJQyvTWELej | AUTO-v2-jef |
56+
"""
57+
self.assertPyxformXform(
58+
md=md,
59+
# setting 'id_string' is ignored.
60+
xml__xpath_match=[
61+
"""
62+
/h:html/h:head/x:model/x:instance/x:test_name[
63+
@id='AUTO-v2-jef'
64+
and @version='vWvvk3GYzjXcJQyvTWELej'
65+
]
66+
"""
67+
],
68+
)
69+
4870

4971
class TestSurveyColumns(PyxformTestCase):
5072
"""
@@ -130,7 +152,6 @@ def test_column_case(self):
130152
Ensure that column name is case insensitive
131153
"""
132154
self.assertPyxformXform(
133-
name="mixedcasecolumns",
134155
md="""
135156
| Survey | | | |
136157
| | Type | name | Label |
@@ -140,6 +161,40 @@ def test_column_case(self):
140161
""",
141162
)
142163

164+
def test_label_caps_alternatives(self):
165+
"""
166+
re: https://github.com/SEL-Columbia/pyxform/issues/76
167+
Capitalization of 'label' column can lead to confusing errors.
168+
"""
169+
170+
self.assertPyxformXform(
171+
md="""
172+
| survey | | | |
173+
| | type | name | label |
174+
| | note | q | Q |
175+
""",
176+
xml__xpath_match=["/h:html/h:body/x:input[./x:label='Q']"],
177+
)
178+
self.assertPyxformXform(
179+
md="""
180+
| survey | | | |
181+
| | type | name | Label |
182+
| | note | q | Q |
183+
""",
184+
xml__xpath_match=["/h:html/h:body/x:input[./x:label='Q']"],
185+
)
186+
187+
def test_calculate_alias(self):
188+
self.assertPyxformXform(
189+
name="calculatealias",
190+
md="""
191+
| survey | | | | |
192+
| | type | name | label | calculate |
193+
| | decimal | amount | Counter | |
194+
| | calculate | doubled | Doubled | ${amount} * 2 |
195+
""",
196+
)
197+
143198
def test_missing_survey_headers(self):
144199
self.assertPyxformXform(
145200
md="""

tests/test_xlsform_headers.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)