def test_post_and_put_profile(self):
        params = {"profileId": "prof:test_post_and_put_profile", "agent": self.testagent}
        path = (reverse('lrs:agent_profile'), urllib.urlencode(params)) % '%s?%s'
        prof = {"test":"post and put profile","obj":{"agent":"mailto:test@example.com"}}
        
        post = self.client.post(path, json.dumps(prof), content_type="application/json", Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(post.status_code, 204)
        
        get = self.client.get(path, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(get.status_code, 200)
        self.assertEqual(json.loads(get.content), prof)
        self.assertEqual(get.get('etag'), '"%s"' % hashlib.sha1(get.content).hexdigest())

        params = {"profileId": "prof:test_post_and_put_profile", "agent": self.testagent}
        path = '%s?%s' % (reverse('lrs:agent_profile'), urllib.urlencode(params))
        prof = {"wipe":"new data"}
        thehash = get.get('etag')
        
        put = self.client.put(path, json.dumps(prof), content_type="application/json", If_Match=thehash, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(put.status_code, 204)
        
        get = self.client.get(path, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(get.status_code, 200)
        self.assertEqual(json.loads(get.content), prof)
        etag = '"%s"' % hashlib.sha1(get.content).hexdigest()
        self.assertEqual(get.get('etag'), etag)

        # params = {"profileId": "prof:test_post_and_put_profile", "agent": self.testagent}
        # path = '%s?%s' % (reverse('lrs:agent_profile'), urllib.urlencode(params))
        # prof = {"test":"post updated profile","obj":{"agent":"mailto:test@example.com", "new":"thing"}, "added":"yes"}
        
        # post = self.client.post(path, json.dumps(prof), content_type="application/json", Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        # self.assertEqual(post.status_code, 409)

        # post = self.client.post(path, json.dumps(prof), content_type="application/json", If_Match=etag, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        # self.assertEqual(post.status_code, 204)

        # get = self.client.get(path, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
        # self.assertEqual(get.status_code, 200)
        # ret_json = json.loads(get.content)
        # self.assertEqual(ret_json['wipe'], "new data")
        # self.assertEqual(ret_json['added'], prof['added'])
        # self.assertEqual(ret_json['test'], prof['test'])
        # self.assertEqual(ret_json['obj']['agent'], prof['obj']['agent'])
        # self.assertEqual(ret_json['obj']['new'], prof['obj']['new'])
        # self.assertEqual(get.get('etag'), '"%s"' % hashlib.sha1(get.content).hexdigest())

        self.client.delete(path, Authorization=self.auth,  X_Experience_API_Version=settings.XAPI_VERSION)
dataset/ETHPy150Open adlnet/ADL_LRS/lrs/tests/test_AgentProfile.py/AgentProfileTests.test_post_and_put_profile/swapped operands of `%`