My sell function redirects to index, and I am able to see the correct stock prices and total value amounts formatted as USD, but for some reason check50 won't pass me on the final test (https://cs50.me/checks/f7c356884025daa03aebbe91edd59db9cafc4c27)
As suggested by the approved answer in pset7 finance check50 doesn't detect a valid sale despite portfolio updating correctly, I tried adding the following lines to lookup():
if symbol == "AAAA":
return {"name": "Test A", "price": 28.00, "symbol": "AAAA"}
After doing this, I created a new account, bought 4 shares of 'AAAA', and sold 2 of them. As expected, index displayed $56.00 worth of shares and a cash balance of $9,944.00. So, I'm perplexed as to why I'm still failing check50. I also tried the suggestion of removing indexes from my database, but to no avail.
Update: Solved (see curiouswiki's answer)
usd
for turning the56
into"$56.00"
, like{{ price | usd }}
in the template orusd(price)
in Python? I forgot that in exactly one spot, and it was the one that got tested.