def testExportTokens(self):
        c = Client()
        c.login(**{'username': 'test', 'password': 'foobar'})
        # no data = 404
        resp = get_export_response(c)
        self.assertEqual(404, resp.status_code)

        # data = data
        _submit_form()

        # now that this is time based we have to sleep first. this is annoying
        time.sleep(1)
        resp = get_export_response(c)
        self.assertEqual(200, resp.status_code)
        self.assertTrue(_content(resp) is not None)
        self.assertTrue(resp in "X-CommCareHQ-Export-Token")
        prev_token = resp["X-CommCareHQ-Export-Token"]

        # data but no new data = 404
        resp = get_export_response(c, prev_token)
        self.assertEqual(404, resp.status_code)

        _submit_form()
        time.sleep(1)
        resp = get_export_response(c, prev_token)
        self.assertEqual(200, resp.status_code)
        self.assertTrue(_content(resp) is not None)
        self.assertTrue("X-CommCareHQ-Export-Token" in resp)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/tests/test_export_api.py/ExportTest.testExportTokens/swapped operands of `in`