def test_current_larger_than_total(self): update_member_stats(self.member, 18, True) self.assertEqual(self.member.total_donations, 24) self.assertEqual(self.member.total_donations_rec, 18)
def test_returning_member(self): # Test to make sure a returning member keeps their total donations. update_member_stats(self.member, 0, False) self.assertEqual(self.member.total_donations, 1000) self.assertEqual(self.member.total_donations_rec, 800)
def test_new_season(self): update_member_stats(self.member, 13, False) self.assertEqual(self.member.total_donations, 1013) self.assertEqual(self.member.total_donations_rec, 800)
def test_total_donations_rec2(self): # Test to make sure total troop donations received are preserved across # seasons. update_member_stats(self.member, 13, True) self.assertEqual(self.member.total_donations, 1000) self.assertEqual(self.member.total_donations_rec, 813)
def test_total_donations2(self): # Test to make sure total troop donations are preserved across seasons. update_member_stats(self.member, 13, False) self.assertEqual(self.member.total_donations, 1013) self.assertEqual(self.member.total_donations_rec, 800)
def test_last_active_date2(self): # Test to make sure all 'last active date' doesn't get set to the date # of the start of a new season. update_member_stats(self.member, 13, False) self.assertGreater(self.member.last_active_time, datetime.datetime(2016, 1, 1))
def test_last_active_date1(self): # Test to make sure 'last active date' doesn't get set to the date of # the start of a new season. update_member_stats(self.member, 0, False) self.assertEqual(self.member.last_active_time, datetime.datetime(2016, 1, 1))
def test_new_member(self): update_member_stats(self.member, 42, False) self.assertEqual(self.member.current_donations, 42) self.assertEqual(self.member.current_donations_rec, None) self.assertEqual(self.member.total_donations, 42) self.assertEqual(self.member.total_donations_rec, None)