def testPartiallyAchieved(self): settings.CAMINUS_DONATION_GOAL = 100 self.donation = Donation.objects.create(quantity=50, user=self.user, status=Donation.STATUS_PAID) ret = context.donation_info(HttpRequest()) self.assertTrue(ret['donation_goal_progress'] == 50) self.assertTrue(ret['donation_month_total'] == 50) self.assertTrue(ret['donation_month_goal'] == 100)
def testNoProgress(self): settings.CAMINUS_DONATION_GOAL = 100 ret = context.donation_info(HttpRequest()) self.assertTrue(ret['donation_goal_progress'] == 0) self.assertTrue(ret['donation_month_total'] == 0) self.assertTrue(ret['donation_month_goal'] == 100)
def testNoGoal(self): delattr(settings, 'CAMINUS_DONATION_GOAL') ret = context.donation_info(HttpRequest()) self.assertTrue(ret['donation_goal_progress'] == 100) self.assertTrue(ret['donation_month_total'] == 0) self.assertTrue(ret['donation_month_goal'] == 0)