Error in tests for budget?

Tell us what’s happening:
This is about the test_create_spend_chart
So I kept getting what, from all I could tell, was a completely valid result. I compared the expected string to what I was returning, newlines and all. I think I found the problem. I added three print statements to the tests,
print(self.food)
print(self.business)
print(self.entertainment)

What I get back are my print Category method for each of those categories, with amounts of deposits and withdrawals equal to those performed only in that test method. I also printed the actual and expected strings. The amounts in the bar graph for “expected” are NOT equal to what those ledgers contain at that point in time. Like it expects a huge amount of the deposit to have been spent on food and it simply hasn’t.
I can share my code, but I don’t think that is the problem. I very well could be wrong. But based on what I see when I print the self.food, self.entertainment and self.business immediately before the chart is created, I think the expectation is incorrect.

I have the actual string and expected string saved to a .txt file that I could share…
Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Budget App

Link to the challenge:

Nevermind. Found another question with the same issue. Percentage is of only money spent, not percentage of money spent for category “x” - not really that clear in instructions but at least I know how to go about fixing it now.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.