def test_post_put_delete(self):
        prof_id = "http://deleteme.too"
        path = '%s?%s' % (reverse('lrs:agent_profile'), urllib.urlencode({"method":"PUT"}))
        content = {"test":"delete profile","obj":{"actor":"test", "testcase":"ie cors post for put and delete"}}
        thedata = "profileId=%s&agent=%s&content=%s&Authorization=%s&Content-Type=application/json&X-Experience-API-Version=1.0.0" % (prof_id, self.testagent, content, self.auth)
        response = self.client.post(path, thedata, content_type="application/x-www-form-urlencoded")
        self.assertEqual(response.status_code, 204)
        r = self.client.get(reverse('lrs:agent_profile'), {"profileId": prof_id, "agent": self.testagent}, Authorization=self.auth, X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(r.status_code, 200)
        import ast
        c = ast.literal_eval(r.content)
        self.assertEqual(c['test'], content['test'])
 
        thedata = "profileId=%s&agent=%s&Authorization=%s&X-Experience-API-Version=1.0" % (prof_id, self.testagent, self.auth)
        path = '%s?%s' % (reverse('lrs:agent_profile'), urllib.urlencode({"method":"DELETE"}))
        r = self.client.post(path, thedata, content_type="application/x-www-form-urlencoded", Authorization=self.auth, X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(r.status_code, 204)

        r = self.client.get(reverse('lrs:agent_profile'), {"profileId": prof_id, "agent": self.testagent}, Authorization=self.auth, X_Experience_API_Version=settings.XAPI_VERSION)
        self.assertEqual(r.status_code, 404)
dataset/ETHPy150Open adlnet/ADL_LRS/lrs/tests/test_AgentProfile.py/AgentProfileTests.test_post_put_delete/original