@@ -246,18 +246,22 @@ def test_student_has_access(self):
246246 chapter = BlockFactory .create (category = "chapter" , parent_location = self .course .location )
247247 overview = CourseOverview .get_from_id (course_key )
248248 subsection = BlockFactory .create (category = "sequential" , parent_location = chapter .location )
249- unit = BlockFactory .create (category = "vertical" , parent_location = subsection .location )
250- html_block = BlockFactory .create (
251- category = "html" ,
252- parent_location = unit .location ,
253- display_name = "Unpublished Block" ,
254- data = '<p>This block should not be published.</p>' ,
255- publish_item = False ,
256- # Not ideal but does ensure that the student doesn't have access. Not really
257- # testing what we want though.
258- visible_to_staff_only = True ,
259- )
260249
250+ with self .store .branch_setting (ModuleStoreEnum .Branch .draft_preferred ):
251+ unit = BlockFactory .create (category = "vertical" , parent_location = subsection .location )
252+ html_block = BlockFactory .create (
253+ category = "html" ,
254+ parent_location = unit .location ,
255+ display_name = "Unpublished Block" ,
256+ data = '<p>This block should not be published.</p>' ,
257+ publish_item = False ,
258+ # Not ideal but does ensure that the student doesn't have access. Not really
259+ # testing what we want though.
260+ # visible_to_staff_only=True,
261+ )
262+ print (self .store .get_branch_setting ())
263+
264+ print (self .store .get_branch_setting ())
261265 # Enroll student to the course
262266 CourseEnrollmentFactory (user = self .student , course_id = self .course .id )
263267
0 commit comments