Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kostrykin committed Oct 6, 2024
1 parent ee705cb commit 2489edd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/stats/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ def test_peach_price(self, mock__Match__award_badges):
mp5 = pmatch.get_participation('76561197962477966')

# Test with ADR right below the threshold
mp5.adr = 0.76 * mp4.adr
mp5.adr = 0.668 * mp4.adr
mp5.save()
models.MatchBadge.award(mp5)
self.assertEqual(len(models.MatchBadge.objects.filter(badge_type = 'peach', participation = mp5)), 0)

# Test with ADR right above the threshold
mp5.adr = 0.74 * mp4.adr
mp5.adr = 0.666 * mp4.adr
mp5.save()
for itr in range(2): # Test twice, the badge should be awarded only once
with self.subTest(itr = itr):
Expand Down

0 comments on commit 2489edd

Please sign in to comment.