|
7 | 7 | from pyxform.section import GroupedSection, RepeatingSection |
8 | 8 | from pyxform.survey import Survey, share_same_repeat_parent |
9 | 9 |
|
10 | | -from tests.pyxform_test_case import PyxformTestCase |
| 10 | +from tests.pyxform_test_case import PYXFORM_TESTS_RUN_ODK_VALIDATE, PyxformTestCase |
11 | 11 |
|
12 | 12 |
|
13 | 13 | class TestSurvey(PyxformTestCase): |
@@ -131,8 +131,8 @@ def build_survey_from_path_spec( |
131 | 131 | shared_path = target_path[:shared_path_length] |
132 | 132 |
|
133 | 133 | # Objects always present once in paths. |
134 | | - target = InputQuestion(name="t", type="string") |
135 | | - source = InputQuestion(name="s", type="string") |
| 134 | + target = InputQuestion(name="t", label="target", type="string") |
| 135 | + source = InputQuestion(name="s", label="source ${t}", type="string") |
136 | 136 | lcar = RepeatingSection(name="a") |
137 | 137 | survey = Survey(name="data") |
138 | 138 | current_parent = survey |
@@ -209,7 +209,11 @@ def assert_relative_path( |
209 | 209 | expect_none = expect_none == "1" |
210 | 210 | msg = (target_xpath, source_xpath, reference_parent, expected, expect_none) |
211 | 211 |
|
212 | | - with self.subTest(msg=msg): |
| 212 | + if PYXFORM_TESTS_RUN_ODK_VALIDATE: |
| 213 | + with self.subTest(msg=f"ODK Validate: {msg}"): |
| 214 | + survey.to_xml(validate=True) |
| 215 | + |
| 216 | + with self.subTest(msg=f"Output Test: {msg}"): |
213 | 217 | relation = source.lowest_common_ancestor( |
214 | 218 | other=target, group_type=const.REPEAT |
215 | 219 | ) |
|
0 commit comments