예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 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))
예제 #7
0
 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))
예제 #8
0
 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)