Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Fixing 0 -> unavailable #45

Merged
merged 2 commits into from
Feb 26, 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
2 changes: 1 addition & 1 deletion openfecwebapp/data_prep/financial_summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _map_committee_financials(vals):

# format totals data in US dollars
for v in value_map:
if value_map[v]:
if value_map[v] is not None:
totals_mapped[v] = locale.currency(
value_map[v], grouping=True)

Expand Down
11 changes: 11 additions & 0 deletions openfecwebapp/tests/data_prep/financial_summaries_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def test_map_committee_financials(self):
self.assertEqual('2009 - 2010', c['years_totals'])
self.assertEqual('End Report ', c['report_desc'])

results = {
'reports': totals['results'][1]['reports'][0],
'totals': totals['results'][1]['totals'][0]
}
c = _map_committee_financials(results)

self.assertEqual('$0.00', c['total_receipts'])
self.assertEqual('$0.00', c['total_disbursements'])
self.assertEqual('$0.00', c['total_cash'])
self.assertEqual('$0.00', c['total_debt'])

def test_get_reports_totals_results(self):
c = _get_reports_totals_results(totals['results'][0])

Expand Down
14 changes: 14 additions & 0 deletions openfecwebapp/tests/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@
'disbursements': 3453.54
}],
'committee_id': 'D1234'
},
{
'reports': [{
'cash_on_hand_end_period': 0,
'debts_owed_by_committee': 0,
'report_year': 2010,
'election_cycle': 2010,
'report_type_full': 'End Report {stuff}'
}],
'totals': [{
'receipts': 0,
'disbursements': 0
}],
'committee_id': 'D1234'
}]
}

Expand Down