def METHOD_NAME(tree_model):
    """Some sanity checks on retrieving flags for nested items"""
    assert not tree_model.hasIndex(5, 0, tree_model.index(1))
    last = tree_model._root.pop()
    tree_model._root[1].append(last)
    assert tree_model.hasIndex(5, 0, tree_model.index(1))
    idx = tree_model.index(5, 0, tree_model.index(1))
    assert bool(tree_model.flags(idx) & Qt.ItemFlag.ItemIsEnabled)