def test_get_new_version_with_publish_check_box_is_checked_creates_published_version(self):
        # select the t1
        item_model = self.dialog.tasks_treeView.model()
        selection_model = self.dialog.tasks_treeView.selectionModel()

        index = item_model.index(0, 0)
        project1_item = item_model.itemFromIndex(index)
        # expand it
        self.dialog.tasks_treeView.expand(index)

        # get first child which is task1
        task1_item = project1_item.child(0, 0)

        # select task1
        selection_model.select(
            task1_item.index(),
            QtGui.QItemSelectionModel.Select
        )

        # first check if unpublished
        new_version = self.dialog.get_new_version()

        # is_published should be True
        self.assertFalse(new_version.is_published)

        # check task
        self.assertEqual(new_version.task, self.test_task1)

        # check the publish checkbox
        self.dialog.publish_checkBox.setChecked(True)

        new_version = self.dialog.get_new_version()

        # check task
        self.assertEqual(new_version.task, self.test_task1)

        # is_published should be True
        self.assertTrue(new_version.is_published)
testing if checking publish_checkbox will create a published Version
dataset/ETHPy150Open eoyilmaz/anima/tests/ui/test_version_creator.py/VersionCreatorTester.test_get_new_version_with_publish_check_box_is_checked_creates_published_version