Skip to content

Commit

Permalink
Merge pull request #520 from lognaturel/release-v1.4.0
Browse files Browse the repository at this point in the history
Prepare for v1.4.0 release
  • Loading branch information
yanokwa authored Feb 23, 2021
2 parents 6886234 + 1abc8e5 commit bee9654
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Pyxform Changelog


# v1.4.0, 2021-02-23

* #514 Fix circular reference error raised when converting an XLSX form with multiple languages to JSON
* Davis Raymond @DavisRayM (Ona)
* #519 Add support for odk:recordaudio
* Callum Stott @seadowg (ODK)

# v1.3.4, 2021-01-15

* #510 Show a more helpful error message is section name is equal to form name
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===============
pyxform v1.3.4
pyxform v1.4.0
===============

|circleci| |appveyor| |codecov| |black|
Expand Down
2 changes: 1 addition & 1 deletion pyxform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Collect easy.
"""

__version__ = "1.3.4"
__version__ = "1.4.0"

from pyxform.builder import (
SurveyElementBuilder,
Expand Down
22 changes: 11 additions & 11 deletions pyxform/tests_v1/test_dynamic_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_handling_dynamic_default(self):
| survey | | | | |
| | type | name | label | default |
| | text | last_name | Last name | not_func$ |
| | integer | age | Your age | some_rando_func() |
| | integer | age | Your age | random() |
"""

self.assertPyxformXform(
Expand All @@ -29,7 +29,7 @@ def test_handling_dynamic_default(self):
model__contains=[
"<last_name>not_func$</last_name>",
"<age/>",
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="some_rando_func()"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="random()"/>',
],
)

Expand All @@ -44,12 +44,12 @@ def test_handling_dynamic_default(self):
self.assertContains(survey_xml, "<age/>", 1)
self.assertContains(
survey_xml,
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="some_rando_func()"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="random()"/>',
1,
)
self.assertNotContains(
survey_xml,
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/age" value="some_rando_func()"/>',
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/age" value="random()"/>',
)

def test_static_defaults(self):
Expand All @@ -75,7 +75,7 @@ def test_handling_dynamic_default_in_repeat(self):
| survey | | | | |
| | type | name | label | default |
| | begin repeat | household | Households | |
| | integer | age | Your age | some_rando_func() |
| | integer | age | Your age | random() |
| | text | feeling | Your feeling | not_func$ |
| | end repeat | household | | |
"""
Expand All @@ -86,10 +86,10 @@ def test_handling_dynamic_default_in_repeat(self):
id_string="id",
model__contains=["<age/>", "<feeling>not_func$</feeling>"],
model__excludes=[
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="some_rando_func()"/>'
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="random()"/>'
],
xml__contains=[
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="some_rando_func()"/>'
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="random()"/>'
],
)

Expand All @@ -104,12 +104,12 @@ def test_handling_dynamic_default_in_repeat(self):
self.assertContains(survey_xml, "<age/>", 2)
self.assertContains(
survey_xml,
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="some_rando_func()"/>',
'<setvalue event="odk-instance-first-load odk-new-repeat" ref="/dynamic/household/age" value="random()"/>',
1,
)
self.assertNotContains(
survey_xml,
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="some_rando_func()"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/age" value="random()"/>',
)

def test_dynamic_default_in_group(self):
Expand Down Expand Up @@ -227,7 +227,7 @@ def test_handling_arithmetic_expression(self):
| | type | name | label | default |
| | text | expr_1 | First expr | 2 + 3 * 4 |
| | text | expr_2 | Second expr | 5 div 5 - 5 |
| | integer | expr_3 | Third expr | expr() + 2 * 5 |
| | integer | expr_3 | Third expr | random() + 2 * 5 |
"""

self.assertPyxformXform(
Expand All @@ -240,7 +240,7 @@ def test_handling_arithmetic_expression(self):
"<expr_3/>",
'<setvalue event="odk-instance-first-load" ref="/dynamic/expr_1" value="2 + 3 * 4"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/expr_2" value="5 div 5 - 5"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/expr_3" value="expr() + 2 * 5"/>',
'<setvalue event="odk-instance-first-load" ref="/dynamic/expr_3" value="random() + 2 * 5"/>',
],
)

Expand Down
1 change: 1 addition & 0 deletions pyxform/tests_v1/test_last_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_last_saved_in_repeat(self):
| | end repeat | my-repeat | | |
| | calculate | baz | | ${foo} + ${last-saved#foo} |
""",
run_odk_validate=False, # This test is more for documentation. The unqualified ref fails Validate.
xml__contains=[
'<instance id="__last-saved" src="jr://instance/last-saved"/>',
'calculate=" ../foo + instance(\'__last-saved\')/last-saved/my-repeat/foo " nodeset="/last-saved/my-repeat/bar"',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="pyxform",
version="1.3.4",
version="1.4.0",
author="github.com/xlsform",
author_email="[email protected]",
packages=find_packages(),
Expand Down

0 comments on commit bee9654

Please sign in to comment.