コード例 #1
0
def test_Donors_Collection_add_new_donor():
    donors_collection = donation_history_initialization()
    new_donor = Donor('New')
    new_donor.add_donation(40)
    donors_collection.add_new_donor(new_donor)
    assert (donors_collection.donors[-1].name == 'New') is True
    assert (donors_collection.donors[-1].donations == [40]) is True
コード例 #2
0
def test_Donor():
    new_donor = Donor('New')
    assert (new_donor.name == 'New') is True

    new_donor.add_donation(40)
    assert (new_donor.donations == [40]) is True