def testExportOptionsXML(self):
        """ Test Export Options (all options, XML) """

        assertEqual = self.assertEqual
        assertTrue = self.assertTrue

        options = dict(self.records)

        # Request options
        resource = current.s3db.resource("fotest_table")
        result = resource.export_options(fields=["lookup"])
        fo = etree.XML(result)

        # Inspect result
        xml = current.xml
        ATTRIBUTE = xml.ATTRIBUTE
        VALUE = ATTRIBUTE.value
        UID = xml.UID

        has_empty = False
        self.assertEqual(len(fo), len(options) + 1)
        for opt in fo:
            assertEqual(opt.tag, "option")
            attr = opt.attrib
            assertTrue(attr in VALUE)
            value = attr[VALUE]
            if value == "":
                has_empty = True
                self.assertFalse(UID in attr)
                assertEqual(opt.text, None)
                continue
            else:
                value = int(value)
            assertTrue(value in options)
            assertEqual(opt.text, options[value]["name"])

        assertTrue(has_empty, msg="Empty-option missing")

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3xml.py/GetFieldOptionsTests.testExportOptionsXML/swapped operands of `in`