add tests for get_dashboard_totals

This commit is contained in:
Leo Hemsted
2016-07-20 14:12:03 +01:00
parent fade656e3b
commit 0cc2a90a1a
4 changed files with 54 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ def get_formatted_percentage(x, tot):
"""
Return a percentage to one decimal place (respecting )
"""
return "{0:.1f}".format((float(x) / tot * 100)) if tot else 0
return "{0:.1f}".format((float(x) / tot * 100)) if tot else '0'
def statistics_by_state(statistics):