def test_thank_you(): a = Donor("Scrooge McDuck", 100.00) print(a.thank_you()) assert a.thank_you() == """ Dear Scrooge McDuck, Thank you for your most recent donation of $100.00. We are humbled by your lifetime contribution of $100.00. Sincerly, Making Good Things Happen""" a.new_donation(1000.00) assert a.thank_you() == """
def test_check_donation(): a = Donor("Scrooge McDuck", 999.91) assert a.donations[0] == 999.91 a.new_donation(100.00) a.new_donation(2) a.new_donation(300.11) assert a.donations[2] == 2.00 print(a.donations)
def test_change_donation2(): a = Donor("Scrooge McDuck", 999.91) a.new_donation(100.00) a.new_donation(2) a.change_donation(1, 1000) assert a.donations[0] == 1000.00
def test_change_donation1(): a = Donor("Scrooge McDuck", 999.91) a.new_donation(100.00) a.new_donation(2) a.change_donation(3, -200) assert a.donations[2] == 0.00
def test_new_donation2(): a = Donor("Scrooge McDuck", 999.91) a.new_donation(-100.00) assert a.donations == [999.91, 0]