Beispiel #1
0
def send_thankyou():
    donor_name = input("Enter the donor's FULL NAME "
                       "or 'List' - to see ALL Donors Names ")

    while donor_name.lower() == "list":
        print(donors.donors_list())
        donor_name = input("Please enter a  FULL Name ")

    try:
        donation_amt = float(input("Enter the Amount for donation "))
    except ValueError:
        print("\n Invalid Amount. Please Enter a valid number \n")
    else:
        if donors.donor_exists(donor_name) is False:
            donor = Donor(donor_name)
            donors.add(donor)
        else:
            donor = donors.donors[donor_name]
        donor.add_donation(donation_amt)
        print(donor.print_thanksnote())
Beispiel #2
0
def test_thankyou_note():
    """ Test  Thank you Note """
    donor = Donor('Urias Gramajo', [1000.00])
    assert '1000.00' in donor.print_thanksnote()
def test_thankyou_note():
    """ Test  Thank you Note """
    donor = Donor('Jeff Bezos', [877.33])
    assert '877.33' in donor.print_thanksnote()