Ejemplo n.º 1
0
 def test_calculate_points(self):
     four_months_before = datetime.now() - timedelta(weeks=15)
     three_months_before = datetime.now() - timedelta(weeks=28)
     points_100 = calculate_points(100, four_months_before)
     points_120 = calculate_points(180, three_months_before)
     print points_100
     print points_120
Ejemplo n.º 2
0
 def test_calculate_points(self):
     four_months_before = datetime.now() - timedelta(weeks=15)
     three_months_before = datetime.now() - timedelta(weeks=28)
     points_100 = calculate_points(100, four_months_before)
     points_120 = calculate_points(180, three_months_before)
     print points_100
     print points_120
Ejemplo n.º 3
0
 def test_calculate_point(self):
     created_date_new = datetime.now() - timedelta(weeks=12)
     created_date_old = datetime.now() - timedelta(weeks=24)
     votes_new = 100
     votes_old = 150
     points_new = calculate_points(votes_new, created_date_new)
     points_old = calculate_points(votes_old, created_date_old)
     self.assertTrue(points_new > points_old)
Ejemplo n.º 4
0
 def test_calculate_point(self):
     created_date_new = datetime.now() - timedelta(weeks=12)
     created_date_old = datetime.now() - timedelta(weeks=24)
     votes_new = 100
     votes_old = 150
     points_new = calculate_points(votes_new, created_date_new)
     points_old = calculate_points(votes_old, created_date_old)
     self.assertTrue(points_new > points_old)
Ejemplo n.º 5
0
 def calculate_rank(self):
     points = calculate_points(self.votes, self.created_date)
     self.points = points
     self.save()
Ejemplo n.º 6
0
 def calculate_rank(self):
     points = calculate_points(self.votes, self.created_date)
     self.points = points
     self.save()