Skip to content

Commit

Permalink
do not make xforms-version a setting
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnR committed Feb 14, 2020
1 parent f392273 commit 870950e
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion pyxform/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
COMPACT_TAG = "compact_tag"

VERSION = "version"
XFORMS_VERSION = "xforms_version"
PUBLIC_KEY = "public_key"
SUBMISSION_URL = "submission_url"
AUTO_SEND = "auto_send"
Expand Down
4 changes: 1 addition & 3 deletions pyxform/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class Survey(Section):
"public_key": unicode,
"instance_xmlns": unicode,
"version": unicode,
"xforms_version": unicode,
"choices": dict,
"style": unicode,
"attribute": dict,
Expand Down Expand Up @@ -488,8 +487,7 @@ def xml_model(self):
self._add_empty_translations()

model_kwargs = {}
if hasattr(self, constants.XFORMS_VERSION):
model_kwargs["odk:xforms-version"] = getattr(self, constants.XFORMS_VERSION)
model_kwargs["odk:xforms-version"] = constants.CURRENT_XFORMS_VERSION

model_children = []
if self._translations:
Expand Down
5 changes: 0 additions & 5 deletions pyxform/tests/builder_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def test_specify_other(self):
expected_dict = {
"name": "specify_other",
"type": "survey",
"xforms_version": "1.0.0",
"title": "specify_other",
"default_language": "default",
"id_string": "specify_other",
Expand Down Expand Up @@ -178,7 +177,6 @@ def test_select_one_question_with_identical_choice_name(self):
"default_language": "default",
"id_string": "choice_name_same_as_select_name",
"type": "survey",
"xforms_version": "1.0.0",
"children": [
{
"children": [{"name": "zone", "label": "Zone"}],
Expand Down Expand Up @@ -212,7 +210,6 @@ def test_loop(self):
"sms_keyword": "loop",
"title": "loop",
"type": "survey",
"xforms_version": "1.0.0",
"default_language": "default",
"children": [
{
Expand Down Expand Up @@ -451,7 +448,6 @@ def test_sms_columns(self):
"sms_separator": "+",
"title": "SMS Example",
"type": "survey",
"xforms_version": "1.0.0",
}
self.assertEqual(survey.to_json_dict(), expected_dict)

Expand Down Expand Up @@ -491,7 +487,6 @@ def test_style_column(self):
"style": "ltr",
"title": "My Survey",
"type": "survey",
"xforms_version": "1.0.0",
}
self.assertEqual(survey.to_json_dict(), expected_dict)

Expand Down
1 change: 0 additions & 1 deletion pyxform/tests/group_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_json(self):
"sms_keyword": "group",
"default_language": "default",
"type": "survey",
"xforms_version": "1.0.0",
"children": [
{
"name": "family_name",
Expand Down
1 change: 0 additions & 1 deletion pyxform/tests/loop_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_loop(self):
"default_language": "default",
"title": "another_loop",
"type": "survey",
"xforms_version": "1.0.0",
"children": [
{
"name": "loop_vehicle_types",
Expand Down
1 change: 0 additions & 1 deletion pyxform/tests/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def test_survey_reader(self):
u"name": u"settings",
u"title": u"My Survey",
u"type": u"survey",
u"xforms_version": u"1.0.0",
u"attribute": {
u"my_number": u"1234567890",
u"my_string": u"lor\xe9m ipsum",
Expand Down
1 change: 0 additions & 1 deletion pyxform/tests/test_expected_output/simple_loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"default_language": "default",
"id_string": "simple_loop",
"type": "survey",
"xforms_version": "1.0.0",
"children": [
{
"children": [
Expand Down
3 changes: 1 addition & 2 deletions pyxform/tests/test_expected_output/yes_or_no_question.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"sms_keyword": "yes_or_no_question",
"default_language": "default",
"id_string": "yes_or_no_question",
"type": "survey",
"xforms_version": "1.0.0",
"type": "survey",
"children": [
{
"choices": [
Expand Down
3 changes: 1 addition & 2 deletions pyxform/xform2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ def __init__(self, xml_file):
"children": [],
"id_string": self.title,
"sms_keyword": self.title,
"default_language": "default",
constants.XFORMS_VERSION: self.model["xforms-version"]
"default_language": "default"
}
self._set_submission_info()
self._set_survey_name()
Expand Down
1 change: 0 additions & 1 deletion pyxform/xls2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ def workbook_to_json(
# problems for formhub.
# constants.VERSION : datetime.datetime.now().strftime("%Y%m%d%H"),
constants.CHILDREN: [],
constants.XFORMS_VERSION: constants.CURRENT_XFORMS_VERSION,
}
# Here the default settings are overridden by those in the settings sheet
json_dict.update(settings)
Expand Down

0 comments on commit 870950e

Please sign in to comment.