Exemple #1
0
def test_update_donor_data():
    my_participant = Participant(fake_participant_conf)
    my_participant._number_of_donations = 2
    my_participant.update_donor_data()
    assert my_participant._top_donor.name == "donor1"
Exemple #2
0
def test_calculate_average_donation_no_donations():
    """Make sure the average donation is properly calculated if there haven't been any donations yet."""
    my_participant = Participant(fake_participant_conf)
    my_participant._total_raised = 0
    my_participant._number_of_donations = 0
    assert my_participant._calculate_average_donation() == 0
Exemple #3
0
def test_update_donation_data_preexisting_donations():
    my_participant = Participant(fake_participant_conf)
    my_participant._number_of_donations = 2
    my_participant.update_donation_data()
    assert my_participant._donation_list[0].name == "Sean Gibson"
Exemple #4
0
def test_calculate_average_donation():
    """Make sure the average donation is properly calculated."""
    my_participant = Participant(fake_participant_conf)
    my_participant._total_raised = 100
    my_participant._number_of_donations = 2
    assert my_participant._calculate_average_donation() == 50