예제 #1
0
def test_donor_entry_normal():
    my_donors = Donors()
    data_entry(my_donors)
    matches = my_donors.match_donor("Fred Smith")
    name_matches = [x[0] for x in matches]
    print(matches)
    assert "Fred Smith" in name_matches
예제 #2
0
def test_donor_entry_misc():
    """
    lazy system test

    This is pretty brittle and lazy, but implicitly tests that
    that a wide variety of functions work becase each step
    needs to act in the predicted manor for you to get to the
    end result.
    """
    my_donors = Donors()
    main(my_donors)
    matches = my_donors.match_donor("Fred Smith")
    name_matches = [x[0] for x in matches]
    print(matches)
    assert "Fred Smith" in name_matches
예제 #3
0
def test_match_donor():
    """ verify the match_donor search functions """
    test_donor_a = Donor(full_name="Joe Smith", donation=100)
    test_donor_a.add_donation(150)
    test_donor_b = Donor(full_name="Mary Jo Kline, III", donation=1000)
    test_donors = Donors(test_donor_a)
    test_donors.add_donor(test_donor_b)

    matches = test_donors.match_donor("Joe Smith")
    name_matches = [x[0] for x in matches]

    print(matches)

    assert "Joe Smith" in name_matches
    assert "Mary Jo Kline, III" not in name_matches