Hello Everyone, hope you are all well. I am trying to complete the ‘Budget app’ problem but I am encountering some issues. I am not sure where I have gone wrong. All tests pass except the last one, from line 102:
‘self.assertEqual(actual, expected, ‘Expected different chart representation. Check that all spacing is exact.’)’
Here is my code (sorry, it’s a mess), any help would be greatly appreciated:
boilerplate-budget-app (10) - Replit
It’s in the budget.py
From the spec:
Besides the Category class, create a function (outside of the class) called create_spend_chart that takes a list of categories as an argument. It should return a string that is a bar chart.
create_spend_chart does not have a
return that I can find, so it returns
None and the test produces the error you are seeing.
Thanks Jeremy. I have fixed the issue but it still doesn’t quite work.
Here is my code:
Between line 93 and 100 in the test module, the default values inputted results in a different graph output. The default values were (Food [+900 deposit, - 155 withdraw], Business [+900 deposit, -30 withdraw], and Entertainment [ +900 deposit, -50 withdraw]).
When my code was ran, these values result in my graph having a percentage of 30% for each category, which I think is correct.
However, the expected graph is distributed as 0%, 70%, and 20%, I do not know where these values come from.
Thanks again your time.