def testSingleNameMatchWithoutParentItem(self):

        db = current.db
        s3db = current.s3db

        assertEqual = self.assertEqual

        otable = s3db.org_organisation
        btable = s3db.org_organisation_branch

        # Verify test organisations are in pristine state
        query = ((otable.name == "DeDupOrgB") |
                 (otable.name == "DeDupBranch1")) & \
                (otable.deleted != True)
        rows = db(query).select(otable.id, otable.comments)
        assertEqual(len(rows), 2)

        for row in rows:
            assertEqual(row.comments, None)

        # Import organisations with single name matches in the DB
        xmlstr = """
<s3xml>
    <resource name="org_organisation">
        <data field="name">DeDupOrgB</data>
        <data field="comments">updated</data>
    </resource>
    <resource name="org_organisation">
        <data field="name">DeDupBranch1</data>
        <data field="comments">updated</data>
    </resource>
</s3xml>"""

        xmltree = etree.ElementTree(etree.fromstring(xmlstr))

        resource = s3db.resource("org_organisation")
        resource.import_xml(xmltree, ignore_errors=True)

        # Verify DEDUPORGB has been updated
        query = (otable.name == "DeDupOrgB") & \
                (otable.deleted != True)
        rows = db(query).select(otable.id, otable.uuid, otable.comments)
        assertEqual(len(rows), 1)
        row = rows.first()
        assertEqual(row.uuid, "DEDUPORGB")
        assertEqual(row.comments, "updated")

        # Verify DEDUPBRANCHA1 has been updated
        query = (otable.name == "DeDupBranch1") & \
                (otable.deleted != True)
        rows = db(query).select(otable.id, otable.uuid, otable.comments)
        assertEqual(len(rows), 1)
        row = rows.first()
        assertEqual(row.uuid, "DEDUPBRANCHA1")
        assertEqual(row.comments, "updated")

    # -------------------------------------------------------------------------
Provides metadata about distinct measurement locations
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3db/org.py/OrgDeduplicationTests.testSingleNameMatchWithoutParentItem--crossover with--dataset/ETHPy150Open dhhagan/py-openaq/openaq/__init__.py/OpenAQ.locations