Skip to content
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

Make tests past #64

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stats/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ def empty_or_percentage_sum_is_100(path, by_vocab=False):
else:
return len(elements) == 1 or sum(decimal_or_zero(x.attrib.get('percentage')) for x in elements) == 100


bools.update({
'version': bools['version'] and self.element.getparent().attrib['version'] in CODELISTS[self._major_version()]['Version'],
'iati-identifier': bools['iati-identifier'] and reporting_org_ref and self.element.find('iati-identifier').text.startswith(reporting_org_ref),
Expand Down
12 changes: 8 additions & 4 deletions stats/tests/test_comprehensiveness.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def test_comprehensiveness_with_validation(key, major_version):
<reporting-org ref="BBB"/>
<iati-identifier>AAA-1</iati-identifier>
<participating-org role="Implementing"/>
<activity-status code="2" />
<activity-status />
<activity-date iso-date="9990-05-01" />
<!-- Must have at least one activity-date of type start-planned or start-actual with valid date -->
<activity-date type="end-planned" iso-date="2014-01-01" />
Expand Down Expand Up @@ -544,11 +544,11 @@ def test_comprehensiveness_with_validation(key, major_version):
<reporting-org ref="BBB"/>
<iati-identifier>AAA-1</iati-identifier>
<participating-org role="4"/><!-- Implementing -->
<activity-status code="2" />
<activity-status />
<activity-date iso-date="9990-05-01" />
<!-- Must have at least one activity-date of type start-planned or start-actual with valid date -->
<activity-date type="end-planned" iso-date="2014-01-01" />
<activity-date type="start-planned" iso-date="2014-0101" />
<activity-date type="3" iso-date="2014-01-01" />
<activity-date type="1" iso-date="2014-0101" />
<sector vocabulary="1" percentage="100" code="a" />
<sector vocabulary="1" percentage="100" code="b" />
<sector vocabulary="2" percentage="100" code="a" />
Expand Down Expand Up @@ -590,7 +590,9 @@ def test_comprehensiveness_with_validation(key, major_version):
<reporting-org ref="AAA"/>
<iati-identifier>AAA-1</iati-identifier>
<participating-org role="Funding"/>
<activity-status code="2" />
<!-- Must have at least one activity-date in the past year (if 'end-actual') or in the future (if type 'end-planned') -->
<activity-date iso-date="2014-01-01" type="start-planned" />
<activity-date iso-date="2015-06-01" type="end-planned" />
<sector vocabulary="DAC" percentage="50" code="11220" />
<sector vocabulary="DAC" percentage="50" code="11240" />
Expand Down Expand Up @@ -632,7 +634,9 @@ def test_comprehensiveness_with_validation(key, major_version):
<reporting-org ref="AAA"/>
<iati-identifier>AAA-1</iati-identifier>
<participating-org role="1"/><!-- Funding -->
<activity-status code="2" />
<!-- Must have at least one activity-date in the past year (if '4') or in the future (if type '3') -->
<activity-date iso-date="2014-01-01" type="1" />
<activity-date iso-date="2015-06-01" type="3" />
<sector vocabulary="1" percentage="50" code="11220" />
<sector vocabulary="1" percentage="50" code="11240" />
Expand Down