Example #1
0
def send_thankyou(donors):
    """
    Accepts arguments and sends to donor.thankyou method
    :param donors: Donor
    :return: None
    """
    recipient = ui("Enter the name of the donor to thank")
    if recipient[0]:
        k = Donor.make_key(recipient[1])
        donor = donors.get(k)
        if donor:
            print(donor.send_message())
        else:
            add_new = ui(
                "Would you like to add this new donor to the database and send a thank you? (Y/N)"
            )
            if add_new[0]:
                if add_new[1].lower() == "y":
                    add_new_donor(donors, recipient[1])
    call_main()
Example #2
0
def test_make_key():
    assert Donor.make_key("Usey Von Username") == "useyvonusername"