'Test the validation messages produced for a unit referring to non-existent user partitions.'

def test_validate_invalid_user_partitions_unit(self):

    self.set_group_access(self.vertical_location, {999: [self.group1.id]})
    validation = self.store.get_item(self.vertical_location).validate()
    self.assertEqual(len(validation.messages), 1)
    self.verify_validation_message(validation.messages[0], INVALID_USER_PARTITION_VALIDATION_UNIT, ValidationMessage.ERROR)
    self.set_group_access(self.vertical_location, {998: [self.group2.id]})
    validation = self.store.get_item(self.vertical_location).validate()
    self.assertEqual(len(validation.messages), 1)
    self.verify_validation_message(validation.messages[0], INVALID_USER_PARTITION_VALIDATION_UNIT, ValidationMessage.ERROR)
