From ce1842bbc42aa127561bd6482c06311a6818dd58 Mon Sep 17 00:00:00 2001 From: Yaw Anokwa Date: Fri, 20 Dec 2019 10:01:56 -0800 Subject: [PATCH 1/3] select1 is not a valid bind type --- pyxform/question.py | 2 +- pyxform/question_type_dictionary.py | 8 +- .../tests/example_xls/instance_xmlns_test.xml | 2 +- .../example_xls/spec_test_expected_output.xml | 18 ++-- pyxform/tests/example_xls/widgets.xml | 22 ++--- pyxform/tests/fixtures/strings.ini | 2 +- .../attribute_columns_test.xml | 18 ++-- .../test_expected_output/cascades_old.xml | 82 +++++++++---------- .../cascading_select_test.xml | 6 +- .../flat_xlsform_test.xml | 18 ++-- .../new_cascading_select.xml | 6 +- .../test_expected_output/old_cascades.xml | 6 +- .../tests/test_expected_output/or_other.xml | 4 +- .../test_expected_output/repeat_date_test.xml | 4 +- .../search_and_select.xml | 2 +- .../select_one_external.xml | 2 +- .../tests/test_expected_output/table-list.xml | 6 +- .../tests/test_expected_output/widgets.xml | 22 ++--- .../xlsform_spec_test.xml | 18 ++-- .../test_expected_output/xml_escaping.xml | 2 +- pyxform/tests/test_output/cascades_old.xml | 82 +++++++++---------- pyxform/tests/xml_tests.py | 2 +- pyxform/tests_v1/test_sheet_columns.py | 2 +- 23 files changed, 168 insertions(+), 168 deletions(-) diff --git a/pyxform/question.py b/pyxform/question.py index 7947692b0..c25eff794 100644 --- a/pyxform/question.py +++ b/pyxform/question.py @@ -134,7 +134,7 @@ def validate(self): choice.validate() def xml_control(self): - assert self.bind["type"] in ["select", "select1", "odk:rank"] + assert self.bind["type"] in ["select", "string", "odk:rank"] survey = self.get_root() control_dict = self.control.copy() # Resolve field references in attributes diff --git a/pyxform/question_type_dictionary.py b/pyxform/question_type_dictionary.py index 49df1f07e..90549ef99 100644 --- a/pyxform/question_type_dictionary.py +++ b/pyxform/question_type_dictionary.py @@ -128,7 +128,7 @@ def generate_new_dict(): } }, "q location": {"control": {"tag": "input"}, "bind": {"type": "geopoint"}}, - "select one": {"control": {"tag": "select1"}, "bind": {"type": "select1"}}, + "select one": {"control": {"tag": "select1"}, "bind": {"type": "string"}}, "select one external": {"control": {"tag": "input"}, "bind": {"type": "string"}}, "add image prompt": { "control": {"tag": "upload", "mediatype": "image/*"}, @@ -174,7 +174,7 @@ def generate_new_dict(): }, "q barcode": {"control": {"tag": "input"}, "bind": {"type": "barcode"}}, "q select": {"control": {"tag": "select"}, "bind": {"type": "select"}}, - "select one using": {"control": {"tag": "select1"}, "bind": {"type": "select1"}}, + "select one using": {"control": {"tag": "select1"}, "bind": {"type": "string"}}, "rank": {"control": {"tag": "odk:rank"}, "bind": {"type": "odk:rank"}}, "image": { "control": {"tag": "upload", "mediatype": "image/*"}, @@ -272,7 +272,7 @@ def generate_new_dict(): "add integer prompt": {"control": {"tag": "input"}, "bind": {"type": "int"}}, "q dateTime": {"control": {"tag": "input"}, "bind": {"type": "dateTime"}}, "date": {"control": {"tag": "input"}, "bind": {"type": "date"}}, - "q select1": {"control": {"tag": "select1"}, "bind": {"type": "select1"}}, + "q select1": {"control": {"tag": "select1"}, "bind": {"type": "string"}}, "start time": { "bind": { "jr:preload": "timestamp", @@ -293,7 +293,7 @@ def generate_new_dict(): }, "add select one prompt using": { "control": {"tag": "select1"}, - "bind": {"type": "select1"}, + "bind": {"type": "string"}, }, "hidden": {"bind": {"type": "string"}}, "uri:subscriberid": { diff --git a/pyxform/tests/example_xls/instance_xmlns_test.xml b/pyxform/tests/example_xls/instance_xmlns_test.xml index 27b8a104c..c75defcb1 100644 --- a/pyxform/tests/example_xls/instance_xmlns_test.xml +++ b/pyxform/tests/example_xls/instance_xmlns_test.xml @@ -10,7 +10,7 @@ - + diff --git a/pyxform/tests/example_xls/spec_test_expected_output.xml b/pyxform/tests/example_xls/spec_test_expected_output.xml index 11e199df6..33dddd9ea 100644 --- a/pyxform/tests/example_xls/spec_test_expected_output.xml +++ b/pyxform/tests/example_xls/spec_test_expected_output.xml @@ -624,25 +624,25 @@ - + - - + + - - - - - - + + + + + + diff --git a/pyxform/tests/example_xls/widgets.xml b/pyxform/tests/example_xls/widgets.xml index 88ccb5200..eddbec7a8 100644 --- a/pyxform/tests/example_xls/widgets.xml +++ b/pyxform/tests/example_xls/widgets.xml @@ -116,7 +116,7 @@ - + @@ -126,18 +126,18 @@ - + - - - - - - + + + + + + - - - + + + diff --git a/pyxform/tests/fixtures/strings.ini b/pyxform/tests/fixtures/strings.ini index 8fc6fe41d..75c32b7ad 100644 --- a/pyxform/tests/fixtures/strings.ini +++ b/pyxform/tests/fixtures/strings.ini @@ -6,7 +6,7 @@ test_answers_can_be_imported_from_xml =