Ejemplo n.º 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
Ejemplo n.º 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))
Ejemplo n.º 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
Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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)