Skip to content

Commit 6b8347c

Browse files
Fix occasional failure in test_agenda_view_team_group_filter_toggle. Commit ready for merge.
- Legacy-Id: 18958
1 parent 475fb37 commit 6b8347c

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

ietf/meeting/tests_js.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from unittest import skipIf
1111

1212
import django
13-
from django.urls import reverse as urlreverse
1413
from django.utils.text import slugify
1514
from django.db.models import F
1615
from pytz import timezone
@@ -30,7 +29,6 @@
3029
Room, TimeSlot, Constraint, ConstraintName,
3130
Meeting, SchedulingEvent, SessionStatusName)
3231
from ietf.meeting.utils import add_event_info_to_session_qs
33-
from ietf.utils.test_runner import IetfLiveServerTestCase
3432
from ietf.utils.test_utils import assert_ical_response_is_valid
3533
from ietf.utils.jstest import IetfSeleniumTestCase, ifSeleniumEnabled, selenium_enabled
3634
from ietf import settings
@@ -702,22 +700,41 @@ def test_agenda_view_team_group_filter_toggle(self):
702700
e.g., 'hackathon', or 'tools' group sessions from being shown/hidden when their parent group
703701
filter button is clicked.
704702
"""
703+
def _schedule_session(meeting, session):
704+
"""Schedule a session, guaranteeing that it is not in a private timeslot"""
705+
SchedTimeSessAssignment.objects.create(
706+
schedule=meeting.schedule,
707+
timeslot=TimeSlotFactory(meeting=meeting),
708+
session=session,
709+
)
710+
705711
wait = WebDriverWait(self.driver, 10)
706712
meeting = Meeting.objects.get(type_id='ietf')
707713
parent_group = GroupFactory(type_id='area')
708714
other_group = GroupFactory(parent=parent_group, type_id='wg')
709715
hackathon_group = GroupFactory(acronym='hackathon', type_id='team', parent=parent_group)
710716

711717
# hackathon session
712-
SessionFactory(
713-
meeting=meeting,
714-
type_id='other',
715-
group=hackathon_group,
716-
name='Hackathon',
718+
#
719+
# Add to schedule ourselves because the default scheduling sometimes puts the session
720+
# in a private timeslot, preventing the session from appearing on the agenda and breaking
721+
# the test.
722+
_schedule_session(
723+
meeting,
724+
SessionFactory(
725+
meeting=meeting,
726+
type_id='other',
727+
group=hackathon_group,
728+
name='Hackathon',
729+
add_to_schedule=False
730+
)
717731
)
718732

719-
# session to cause the parent_group to appear in the filter UI tables
720-
SessionFactory(meeting=meeting, type_id='regular', group=other_group)
733+
# Session to cause the parent_group to appear in the filter UI tables.
734+
_schedule_session(
735+
meeting,
736+
SessionFactory(meeting=meeting, type_id='regular', group=other_group, add_to_schedule=False)
737+
)
721738

722739
self.login()
723740
url = self.absreverse('ietf.meeting.views.agenda')

0 commit comments

Comments
 (0)