def METHOD_NAME(self):
    case_id = uuid.uuid4().hex
    parent_case_id = uuid.uuid4().hex
    grandparent_case_id = uuid.uuid4().hex
    structure = CaseStructure(
        case_id=case_id,
        indices=[
            CaseIndex(CaseStructure(
                case_id=parent_case_id,
                indices=[
                    CaseIndex(CaseStructure(case_id=grandparent_case_id))
                ]))
        ]
    )
    structure.walk_related = False
    self.assertEqual(
        [case_id],
        list(structure.walk_ids())
    )
    structure.walk_related = True
    structure.indices[0].related_structure.walk_related = False
    self.assertEqual(
        [case_id, parent_case_id],
        list(structure.walk_ids())
    )