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

Add notices for Budgeted and Actual Expenditure comparison #109

Merged
merged 11 commits into from
Jan 24, 2019

Conversation

otterbotter
Copy link
Contributor

@otterbotter otterbotter commented Jan 22, 2019

This PR:

  • Changes the way we detect if the amount of cells returned is higher than the set limit (looks like a OpenSpending API bug, to be reported)
  • ➕ Adds notices to the Budgeted and Actual Expenditure comparison summary section
  • ➕ Adds notices to the Budgeted and Actual Expenditure comparison programme breakdown section
  • ➕ Adds two new test cases, for a total of 7 new tests.

Notices appear for the summary section when:

  • Data has not been published (total for a given year is empty)
    -- E.g. Please note that the data for 2014, 2013 and 2012 has not been published on vulekamali.
  • A department did not exist for at least one year. (total for a given year is > 0, but no data for this dept in this year)
    -- E.g. This department did not exist for some years displayed.

A notice appears for the programme breakdown section when:

  • Any programme in any year is missing data for all 4 phases.
    -- One or more programmes did not exist for some years displayed.

Notices are presented as a list of strings in the top level of the YAML output, e.g.:

  notices: ['This department did not exist for some years displayed.']
  programmes:
  - items: ...

📓 Notes:

* Add notice message when a department did not exist for one or more years.
* WIP on changing condition for notice from requiring only 1 missing
phase to requiring all 4 phases to be missing
* Only raise program notice in correct cases
@@ -11,10 +11,15 @@
from budgetportal import models
from django.test import TestCase
from mock import Mock
import json

with open('budgetportal/tests/test_data/budget_and_actual.json', 'r') as mock_data:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice - I've been thinking and googled a bit around conventions for this - did you just decide to do it this way or is this a convention you found somewherE?

@jbothma jbothma merged commit c019478 into master Jan 24, 2019
@jbothma jbothma deleted the budget_actual_notices branch January 24, 2019 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants