'Test the validation messages produced for components within
a content group experiment (also known as a split_test).
Ensures that children of split_test xblocks only validate
their access settings off the parent, rather than any
grandparent.'

def test_validate_nonsensical_access_for_split_test_children(self):

    self.set_group_access(self.vertical_location, {self.user_partition.id: [self.group1.id]})
    self.set_group_access(self.split_test_location, {self.user_partition.id: [self.group2.id]})
    self.set_group_access(self.child_vertical_location, {self.user_partition.id: [self.group2.id]})
    self.set_group_access(self.child_html_module_location, {self.user_partition.id: [self.group2.id]})
    validation = self.store.get_item(self.child_html_module_location).validate()
    self.assertEqual(len(validation.messages), 0)
    self.set_group_access(self.child_html_module_location, {self.user_partition.id: [self.group1.id]})
    validation = self.store.get_item(self.child_html_module_location).validate()
    self.assertEqual(len(validation.messages), 1)
    self.verify_validation_message(validation.messages[0], NONSENSICAL_ACCESS_RESTRICTION, ValidationMessage.ERROR)
