-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to pyxform 1.5.0 #699
Conversation
pyxform.errors.PyXFormError: The name "start_time" is the same as the form name. Use a different section name (or change the form name in the "name" column of the settings sheet).
replacing `select` and `select1` for `string` as types for select* questions means we can just check for `question.type` and pyxform's constant instead
Note to use |
forgot to pip-compile on prod.in, new syntax generated
pyxform #529 fixes new error that shouldn't be here
* Recognize select questions from the question elements themselves instead of checking the bind type; see XLSForm/pyxform#168 * Recognize new error message when a group name matches the form name See XLSForm/pyxform#510 * Set `allow_choice_duplicates` to `yes` in cascade test XLSForms See XLSForm/pyxform#23; XLSForm/pyxform#373 (comment) * Update tests to use `default_name` instead of relying on the XLSForm file name See XLSForm/pyxform#130 * Update expected XML in tests to match new pyxform behavior: * `<model>` becomes `<model odk:xforms-version="1.0.0">` * See XLSForm/pyxform#393 * The bind type for `select` and `select1` becomes `string` * See XLSForm/pyxform#168 * `calculate="concat('uuid:', uuid())"` becomes `jr:preload="uid"` * See XLSForm/pyxform#94 This squashed set of changes includes work from #699. Thanks to @duvld for that contribution.
* Recognize select questions from the question elements themselves instead of checking the bind type; see XLSForm/pyxform#168 * Recognize new error message when a group name matches the form name See XLSForm/pyxform#510 * Set `allow_choice_duplicates` to `yes` in cascade test XLSForms See XLSForm/pyxform#23; XLSForm/pyxform#373 (comment) * Update tests to use `default_name` instead of relying on the XLSForm file name See XLSForm/pyxform#130 * Update expected XML in tests to match new pyxform behavior: * `<model>` becomes `<model odk:xforms-version="1.0.0">` * See XLSForm/pyxform#393 * The bind type for `select` and `select1` becomes `string` * See XLSForm/pyxform#168 * `calculate="concat('uuid:', uuid())"` becomes `jr:preload="uid"` * See XLSForm/pyxform#94 This squashed set of changes includes work from #699. Thanks to @duvld for that contribution.
@noliveleger, we missed an important caveat on
As a result, pretty significant differences in XML, like the example below, were sailing through unit tests completely undetected. I've now removed @@ -1,9 +1,9 @@
-(Pdb) print(pyxform_version_agnostic(content))
+(Pdb) print(pyxform_version_agnostic(form_xml % data))
<?xml version="1.0" encoding="utf-8"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
<h:title>transportation_2011_07_25</h:title>
- <model odk:xforms-version="1.0.0">
+ <model>
<instance>
<transportation_2011_07_25 id="transportation_2011_07_25">
<formhub>
@@ -47,19 +47,19 @@
</meta>
</transportation_2011_07_25>
</instance>
- <bind nodeset="/transportation_2011_07_25/transport/available_transportation_types_to_referral_facility" type="string"/>
+ <bind nodeset="/transportation_2011_07_25/transport/available_transportation_types_to_referral_facility" type="select"/>
<bind nodeset="/transportation_2011_07_25/transport/available_transportation_types_to_referral_facility_other" relevant="selected(../available_transportation_types_to_referral_facility, 'other')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/ambulance/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'ambulance')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/bicycle/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'bicycle')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/boat_canoe/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'boat_canoe')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/bus/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'bus')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/donkey_mule_cart/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'donkey_mule_cart')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/keke_pepe/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'keke_pepe')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/lorry/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'lorry')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/motorbike/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'motorbike')" type="string"/>
- <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/taxi/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'taxi')" type="string"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/ambulance/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'ambulance')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/bicycle/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'bicycle')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/boat_canoe/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'boat_canoe')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/bus/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'bus')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/donkey_mule_cart/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'donkey_mule_cart')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/keke_pepe/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'keke_pepe')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/lorry/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'lorry')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/motorbike/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'motorbike')" type="select1"/>
+ <bind nodeset="/transportation_2011_07_25/transport/loop_over_transport_types_frequency/taxi/frequency_to_referral_facility" relevant="selected( /transportation_2011_07_25/transport/available_transportation_types_to_referral_facility , 'taxi')" type="select1"/>
<bind nodeset="/transportation_2011_07_25/meta/instanceID" readonly="true()" type="string"/>
- <bind nodeset="/transportation_2011_07_25/formhub/uuid" type="string" calculate="'ad758136cb284523815120ba0df3bb78'"/>
+ <bind calculate="'ad758136cb284523815120ba0df3bb78'" nodeset="/transportation_2011_07_25/formhub/uuid" type="string"/>
</model>
</h:head>
<h:body> |
Closed by #719 |
Upgrade
pyxform
dependency to latest version and fix broken tests.Last of broken tests:
76cfa07 fixes:
Tests failed because
pyxform
now doesn't like questions having the same name as surveys. The survey before the changed one already has a question as a no spaces truncation of the survey title, so style is copied overb391112 fixes:
Test failed because the duplicate naming error message is changed as error is thrown for form-question names, as well as group names
fb3a9fd and e394b1a fixes:
Tests failed because XLSForm/pyxform#410 changed bind types of
select*
questions fromselect
andselect1
tostring
. It's likely intention ofquestion.bind.get("type") == MULTIPLE_SELECT_BIND_TYPE
is to make sure the type isselect
and notselect1
.select all that apply
should just replace the logicbe4eb8a fixes:
Tests failed because
pyxform.builder.create_survey_from_xls
now needs a parameter to specify the names of the surveys