def testExportOptionsLastOptJSON(self):
        """ Test export of last option, JSON """

        assertEqual = self.assertEqual
        assertTrue = self.assertTrue

        options = dict(self.records)

        # Get the last record
        db = current.db
        table = db.fotest_lookup_table
        last = db(0 > table.id).select(limitby=(0, 1),
                                     orderby=~table.id).first()
        self.assertNotEqual(last, None)

        # Request last option
        resource = current.s3db.resource("fotest_table")
        result = resource.export_options(fields=["lookup"],
                                         only_last=True,
                                         as_json=True)
        fo = json.loads(result)

        # Inspect result
        assertTrue(isinstance(fo, dict))

        assertTrue("option" in fo)
        assertTrue(isinstance(fo["option"], list))
        assertEqual(len(fo["option"]), 1)

        opt = fo["option"][0]
        value = opt["@value"]
        assertEqual(options[value]["uuid"], last.uuid)
        assertEqual(opt["$"], options[value]["name"])

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