def testDeleteBranch(self):

        # Add additional nodes
        xmlstr = """
<s3xml>
    <resource name="test_hierarchy" uuid="HIERARCHY1-3">
        <data field="name">Type 1-3</data>
        <reference field="parent" resource="test_hierarchy" uuid="HIERARCHY1"/>
    </resource>
    <resource name="test_hierarchy" uuid="HIERARCHY1-3-1">
        <data field="name">Type 1-3-1</data>
        <reference field="parent" resource="test_hierarchy" uuid="HIERARCHY1-3"/>
    </resource>
    <resource name="test_hierarchy" uuid="HIERARCHY1-3-2">
        <data field="name">Type 1-3-2</data>
        <reference field="parent" resource="test_hierarchy" uuid="HIERARCHY1-3"/>
    </resource>
</s3xml>
"""
        xmltree = etree.ElementTree(etree.fromstring(xmlstr))

        resource = current.s3db.resource("test_hierarchy")
        resource.import_xml(xmltree)

        # Commit here, otherwise failing deletion will roll back the import, too
        db = current.db
        db.commit()

        assertTrue = self.assertTrue
        assertFalse = self.assertFalse
        assertEqual = self.assertEqual

        table = db.test_hierarchy
        try:
            # Capture the uuids
            rows = db(table.uuid.like("HIERARCHY1-3%")).select()

            uids = {}
            for row in rows:
                assertFalse(row.deleted)
                uids[row.uuid] = row.id

            # Mark as dirty after import
            h = S3Hierarchy("test_hierarchy")
            h.dirty("test_hierarchy")

            # Verify that branch node has been added to the hierarchy
            branches = h.children(self.uids["HIERARCHY1"])
            assertTrue(uids["HIERARCHY1-3"] in branches)

            # Verify that children have been added, too
            children = h.children(uids["HIERARCHY1-3"])
            assertEqual(len(children), 2)

            # Delete the branch
            success = h.delete([uids["HIERARCHY1-3"]])
            assertEqual(success, 3)

            # Verify that branch has been deleted
            branches = h.children(self.uids["HIERARCHY1"])
            assertFalse(uids["HIERARCHY1-3"] in branches)

            # Child nodes must be gone as well
            nodes = h.nodes
            assertTrue(all(uids[uid] not in nodes for uid in uids))

            # Verify that the nodes are deleted from database too
            rows = db(table.uuid.like("HIERARCHY1-3%")).select()
            for row in rows:
                assertTrue(row.deleted)
                uids[row.uuid] = row.id
        finally:
            # Cleanup
            db(table.uuid.like("HIERARCHY1-3%")).delete()

    # -------------------------------------------------------------------------
testing if checking publish_checkbox will create a published Version
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3hierarchy.py/S3HierarchyTests.testDeleteBranch--crossover with--dataset/ETHPy150Open eoyilmaz/anima/tests/ui/test_version_creator.py/VersionCreatorTester.test_get_new_version_with_publish_check_box_is_checked_creates_published_version