def test_tasks_treeView_lists_only_my_tasks_if_checked(self):
        item_model = self.dialog.tasks_treeView.model()
        selection_model = self.dialog.tasks_treeView.selectionModel()

        # check show my tasks only check box
        self.dialog.my_tasks_only_checkBox.setChecked(True)

        # check if all my tasks are represented in the tree
        my_tasks = self.admin.tasks

        # generate a list of parent tasks
        all_my_parent_tasks = []
        for task in my_tasks:
            all_my_parent_tasks += task.parents

        all_my_parent_tasks = list(set(all_my_parent_tasks))

        for task in my_tasks:
            self.dialog.find_and_select_entity_item_in_treeView(
                task,
                self.dialog.tasks_treeView
            )
            # get the current selection
            self.assertEqual(
                task,
                self.dialog.get_task()
            )

        # check if non of the other tasks or their parents are visible
        for task in self.all_tasks:
            if task not in my_tasks and task not in all_my_parent_tasks:
                self.dialog.find_and_select_entity_item_in_treeView(
                    task,
                    self.dialog.tasks_treeView
                )
                # get the current selection
                self.assertTrue(self.dialog.get_task() is None)

        # now un check it and check if all tasks are shown
        self.dialog.my_tasks_only_checkBox.setChecked(False)
        # check if all the tasks are present in the tree
        for task in self.all_tasks:
            self.dialog.find_and_select_entity_item_in_treeView(
                task,
                self.dialog.tasks_treeView
            )
            # get the current selection
            self.assertEqual(self.dialog.get_task(), task)
testing if the tasks_treeView lists only my tasks if
dataset/ETHPy150Open eoyilmaz/anima/tests/ui/test_version_creator.py/VersionCreatorTester.test_tasks_treeView_lists_only_my_tasks_if_checked