Skip to content

Commit

Permalink
Fix test_availability tests
Browse files Browse the repository at this point in the history
  • Loading branch information
czlee committed Sep 14, 2016
1 parent c09fc60 commit 8f05f0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tabbycat/availability/tests/test_availability.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from participants.models import Adjudicator
from participants.models import Adjudicator, Institution
from tournaments.models import Round
from utils.tests import BaseDebateTestCase

Expand Down Expand Up @@ -27,15 +27,19 @@ def test_one_disabled(self):
self.assertEqual(7, self.round.active_adjudicators.count())

def test_activate_all(self):
Adjudicator.objects.create(institution=Institution.objects.get(code="INS0"), name="Unattached")
self.t.preferences['league_options__share_adjs'] = False
self.t.preferences['league_options__share_venues'] = False
activate_all(self.round)
self.assertEqual(8, self.round.active_adjudicators.count())
self.assertEqual(12, self.round.active_teams.count())
self.assertEqual(8, self.round.active_venues.count())

def test_activate_relevant(self):
Adjudicator.objects.create(institution=Institution.objects.get(code="INS0"), name="Unattached")
self.t.preferences['league_options__share_adjs'] = True
self.t.preferences['league_options__share_venues'] = True
activate_all(self.round)
self.assertEqual(8, self.round.active_adjudicators.count())
self.assertEqual(9, self.round.active_adjudicators.count())
self.assertEqual(12, self.round.active_teams.count())
self.assertEqual(16, self.round.active_venues.count())

0 comments on commit 8f05f0b

Please sign in to comment.