예제 #1
0
def _get_staff_lock_from(xblock):
    """
    Returns a string representation of the section or subsection that sets the xblock's release date
    """
    source = find_staff_lock_source(xblock)
    return _xblock_type_and_display_name(source) if source else None
예제 #2
0
 def test_no_source_for_vertical(self):
     """Tests a vertical with no staff lock set anywhere"""
     self._update_staff_locks(False, False, False)
     self.assertIsNone(utils.find_staff_lock_source(self.vertical))
예제 #3
0
def _get_staff_lock_from(xblock):
    """
    Returns a string representation of the section or subsection that sets the xblock's release date
    """
    source = find_staff_lock_source(xblock)
    return _xblock_type_and_display_name(source) if source else None
예제 #4
0
 def test_orphan_has_no_source(self):
     """Tests that a orphaned xblock has no staff lock source"""
     self.assertIsNone(utils.find_staff_lock_source(self.orphan))
예제 #5
0
 def _verify_staff_lock_source(self, item, expected_source):
     """Helper to verify that the staff lock source of a given item matches the expected source"""
     source = utils.find_staff_lock_source(item)
     self.assertEqual(source.location, expected_source.location)
     self.assertTrue(source.visible_to_staff_only)
예제 #6
0
 def test_no_source_for_vertical(self):
     """Tests a vertical with no staff lock set anywhere"""
     self._update_staff_locks(False, False, False)
     self.assertIsNone(utils.find_staff_lock_source(self.vertical))
예제 #7
0
 def test_orphan_has_no_source(self):
     """Tests that a orphaned xblock has no staff lock source"""
     self.assertIsNone(utils.find_staff_lock_source(self.orphan))
예제 #8
0
 def _verify_staff_lock_source(self, item, expected_source):
     """Helper to verify that the staff lock source of a given item matches the expected source"""
     source = utils.find_staff_lock_source(item)
     self.assertEqual(source.location, expected_source.location)
     self.assertTrue(source.visible_to_staff_only)