Skip to content

Commit

Permalink
Force secondary instance creation so query can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel committed Apr 16, 2021
1 parent 3e60bcc commit e36fb3e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions pyxform/tests_v1/test_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,16 +678,16 @@ def test_repeat_using_select_with_reference_path_in_predicate_uses_current(self,
Test relative path expansion using current if reference path is inside a predicate in a survey with select choice list
"""
xlsform_md = """
| survey | | | | |
| | type | name | label | calculation |
| | begin repeat | item-repeat | Item | |
| | calculate | item-counter | | position(..) |
| | calculate | item | | instance('item')/root/item[itemindex=${item-counter}]/label |
| | begin group | item-info | Item info | |
| | note | item-note | All the following questions are about ${item}. | |
| | select one item | stock-item | Do you stock this item? | |
| | end group | item-info | | |
| | end repeat | | | |
| survey | | | | | |
| | type | name | label | choice_filter | calculation |
| | begin repeat | item-repeat | Item | | |
| | calculate | item-counter | | | position(..) |
| | calculate | item | | | instance('item')/root/item[itemindex=${item-counter}]/label |
| | begin group | item-info | Item info | | |
| | note | item-note | All the following questions are about ${item}. | | |
| | select one item | stock-item | Do you stock this item? | true() | |
| | end group | item-info | | | |
| | end repeat | | | | |
| choices | | | | |
| | list_name | name | label | itemindex |
| | item | gasoline-regular | Gasoline, Regular | 1 |
Expand All @@ -709,16 +709,16 @@ def test_repeat_using_select_uses_current_with_reference_path_in_predicate_and_i
Test relative path expansion using current if reference path is inside a predicate and instance is not first expression in a survey with select choice list
"""
xlsform_md = """
| survey | | | | |
| | type | name | label | calculation |
| | begin repeat | item-repeat | Item | |
| | calculate | item-counter | | position(..) |
| | calculate | item | | ${item-counter} + instance('item')/root/item[itemindex=${item-counter}]/label |
| | begin group | item-info | Item info | |
| | note | item-note | All the following questions are about ${item}. | |
| | select one item | stock-item | Do you stock this item? | |
| | end group | item-info | | |
| | end repeat | | | |
| survey | | | | | |
| | type | name | label | choice_filter | calculation |
| | begin repeat | item-repeat | Item | | |
| | calculate | item-counter | | | position(..) |
| | calculate | item | | | ${item-counter} + instance('item')/root/item[itemindex=${item-counter}]/label |
| | begin group | item-info | Item info | | |
| | note | item-note | All the following questions are about ${item}. | | |
| | select one item | stock-item | Do you stock this item? | true() | |
| | end group | item-info | | | |
| | end repeat | | | | |
| choices | | | | |
| | list_name | name | label | itemindex |
| | item | gasoline-regular | Gasoline, Regular | 1 |
Expand Down

0 comments on commit e36fb3e

Please sign in to comment.