|
10 | 10 | from unittest import skipIf |
11 | 11 |
|
12 | 12 | import django |
13 | | -from django.urls import reverse as urlreverse |
14 | 13 | from django.utils.text import slugify |
15 | 14 | from django.db.models import F |
16 | 15 | from pytz import timezone |
|
30 | 29 | Room, TimeSlot, Constraint, ConstraintName, |
31 | 30 | Meeting, SchedulingEvent, SessionStatusName) |
32 | 31 | from ietf.meeting.utils import add_event_info_to_session_qs |
33 | | -from ietf.utils.test_runner import IetfLiveServerTestCase |
34 | 32 | from ietf.utils.test_utils import assert_ical_response_is_valid |
35 | 33 | from ietf.utils.jstest import IetfSeleniumTestCase, ifSeleniumEnabled, selenium_enabled |
36 | 34 | from ietf import settings |
@@ -702,22 +700,41 @@ def test_agenda_view_team_group_filter_toggle(self): |
702 | 700 | e.g., 'hackathon', or 'tools' group sessions from being shown/hidden when their parent group |
703 | 701 | filter button is clicked. |
704 | 702 | """ |
| 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 | + |
705 | 711 | wait = WebDriverWait(self.driver, 10) |
706 | 712 | meeting = Meeting.objects.get(type_id='ietf') |
707 | 713 | parent_group = GroupFactory(type_id='area') |
708 | 714 | other_group = GroupFactory(parent=parent_group, type_id='wg') |
709 | 715 | hackathon_group = GroupFactory(acronym='hackathon', type_id='team', parent=parent_group) |
710 | 716 |
|
711 | 717 | # 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 | + ) |
717 | 731 | ) |
718 | 732 |
|
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 | + ) |
721 | 738 |
|
722 | 739 | self.login() |
723 | 740 | url = self.absreverse('ietf.meeting.views.agenda') |
|
0 commit comments