@@ -4527,6 +4527,7 @@ def test_persistent_enabled_timeslot_types(self):
4527
4527
4528
4528
4529
4529
class SessionDetailsTests (TestCase ):
4530
+ settings_temp_path_overrides = TestCase .settings_temp_path_overrides + ['SLIDE_STAGING_PATH' ]
4530
4531
4531
4532
def test_session_details (self ):
4532
4533
@@ -4659,6 +4660,85 @@ def test_add_session_drafts(self):
4659
4660
q = PyQuery (r .content )
4660
4661
self .assertEqual (1 ,len (q (".alert-warning:contains('may affect published proceedings')" )))
4661
4662
4663
+ def test_proposed_slides_for_approval (self ):
4664
+ # This test overlaps somewhat with MaterialsTests of proposed slides handling. The focus
4665
+ # here is on the display of slides, not the approval action.
4666
+ group = GroupFactory ()
4667
+ meeting = MeetingFactory (
4668
+ type_id = "ietf" , date = date_today () + datetime .timedelta (days = 10 )
4669
+ )
4670
+ sessions = SessionFactory .create_batch (
4671
+ 2 ,
4672
+ group = group ,
4673
+ meeting = meeting ,
4674
+ )
4675
+
4676
+ # slides submission _not_ in the `pending` state
4677
+ do_not_show = [
4678
+ SlideSubmissionFactory (
4679
+ session = sessions [0 ],
4680
+ title = "already approved" ,
4681
+ status_id = "approved" ,
4682
+ ),
4683
+ SlideSubmissionFactory (
4684
+ session = sessions [1 ],
4685
+ title = "already rejected" ,
4686
+ status_id = "rejected" ,
4687
+ ),
4688
+ ]
4689
+
4690
+ # pending submissions
4691
+ first_session_pending = SlideSubmissionFactory (
4692
+ session = sessions [0 ], title = "first session title"
4693
+ )
4694
+ second_session_pending = SlideSubmissionFactory (
4695
+ session = sessions [1 ], title = "second session title"
4696
+ )
4697
+
4698
+ # and their approval URLs
4699
+ def _approval_url (slidesub ):
4700
+ return urlreverse (
4701
+ "ietf.meeting.views.approve_proposed_slides" ,
4702
+ kwargs = {"slidesubmission_id" : slidesub .pk , "num" : meeting .number },
4703
+ )
4704
+
4705
+ first_approval_url = _approval_url (first_session_pending )
4706
+ second_approval_url = _approval_url (second_session_pending )
4707
+ do_not_show_urls = [_approval_url (ss ) for ss in do_not_show ]
4708
+
4709
+ # Retrieve the URL as a group chair
4710
+ url = urlreverse (
4711
+ "ietf.meeting.views.session_details" ,
4712
+ kwargs = {
4713
+ "num" : meeting .number ,
4714
+ "acronym" : group .acronym ,
4715
+ },
4716
+ )
4717
+ chair = RoleFactory (group = group , name_id = "chair" ).person
4718
+ self .client .login (
4719
+ username = chair .user .username , password = f"{ chair .user .username } +password"
4720
+ )
4721
+ r = self .client .get (url )
4722
+ self .assertEqual (r .status_code , 200 )
4723
+ pq = PyQuery (r .content )
4724
+ self .assertEqual (
4725
+ len (pq (f'a[href="{ first_approval_url } "]' )),
4726
+ 1 ,
4727
+ "first session proposed slides should be linked for approval" ,
4728
+ )
4729
+ self .assertEqual (
4730
+ len (pq (f'a[href="{ second_approval_url } "]' )),
4731
+ 1 ,
4732
+ "second session proposed slides should be linked for approval" ,
4733
+ )
4734
+ for no_show_url in do_not_show_urls :
4735
+ self .assertEqual (
4736
+ len (pq (f'a[href="{ no_show_url } "]' )),
4737
+ 0 ,
4738
+ "second session proposed slides should be linked for approval" ,
4739
+ )
4740
+
4741
+
4662
4742
class EditScheduleListTests (TestCase ):
4663
4743
def setUp (self ):
4664
4744
super ().setUp ()
0 commit comments