def test_sequential_and_problem_have_group_access(self): """ Tests when group_access is set on a few different components. """ self.set_group_access(self.sequential, {1: [0]}) # This is a no-op. self.set_group_access(self.vertical, {1: []}) self.set_group_access(self.problem, {2: [3, 4]}) # Note that "has_children_visible_to_specific_partition_groups" only checks immediate children. self.assertFalse( utils.has_children_visible_to_specific_partition_groups( self.sequential)) self.assertTrue( utils.has_children_visible_to_specific_partition_groups( self.vertical)) self.assertFalse( utils.has_children_visible_to_specific_partition_groups(self.html)) self.assertFalse( utils.has_children_visible_to_specific_partition_groups( self.problem)) self.assertTrue( utils.is_visible_to_specific_partition_groups(self.sequential)) self.assertFalse( utils.is_visible_to_specific_partition_groups(self.vertical)) self.assertFalse( utils.is_visible_to_specific_partition_groups(self.html)) self.assertTrue( utils.is_visible_to_specific_partition_groups(self.problem))
def verify_all_components_visible_to_all(): """ Verifies when group_access has not been set on anything. """ for item in (self.sequential, self.vertical, self.html, self.problem): self.assertFalse( utils.has_children_visible_to_specific_partition_groups( item)) self.assertFalse( utils.is_visible_to_specific_partition_groups(item))