Skip to content

Commit

Permalink
Test: Add test of tournament with shared best country
Browse files Browse the repository at this point in the history
  • Loading branch information
UEWBot committed Mar 10, 2024
1 parent 41223f2 commit b316039
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions visualiser/tournament/test_wdd_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,21 @@ def test_classification_many_awards(self):
# Clean up
self.t.awards.exclude(pk__in=[a.pk for a in orig_awards]).delete()

def test_classification_tied_best_country(self):
a = self.t.awards.filter(power__isnull=False).first()
orig_tps = list(a.tournamentplayer_set.all())
for gp in GamePlayer.objects.filter(power=a.power,
game__the_round__tournament=self.t).all():
# Add this player to the list
tp = gp.tournamentplayer()
tp.awards.add(a)
response = self.client.get(reverse('csv_classification',
args=(self.t.pk,)),
secure=True)
self.assertEqual(response.status_code, 200)
# Clean up
for tp in a.tournamentplayer_set.exclude(pk__in=[tp.pk for tp in orig_tps]).all():
a.tournamentplayer_set.remove(tp)

def test_boards(self):
response = self.client.get(reverse('csv_boards',
Expand Down

0 comments on commit b316039

Please sign in to comment.