Commit 4d11eac0 authored by Emmy Vouriot's avatar Emmy Vouriot Committed by Jérome Perrin

remove encode in py3

parent 1f79c5c7
...@@ -604,7 +604,7 @@ return json.dumps({ ...@@ -604,7 +604,7 @@ return json.dumps({
raise ValueError("Unexcpected Answer %s" % response) raise ValueError("Unexcpected Answer %s" % response)
self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201) self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201)
self.portal.REQUEST.RESPONSE.setStatus(200) self.portal.REQUEST.RESPONSE.setStatus(200)
person = self.portal.restrictedTraverse(response['id'].encode()) person = self.portal.restrictedTraverse(response['id'].encode() if six.PY2 else response["id"])
self.assertEqual(person.getTitle(), self.id_template) self.assertEqual(person.getTitle(), self.id_template)
def createUpdateScriptjIOWebSectionCreateOrganisationFromJSON(self): def createUpdateScriptjIOWebSectionCreateOrganisationFromJSON(self):
...@@ -651,7 +651,7 @@ return json.dumps({ ...@@ -651,7 +651,7 @@ return json.dumps({
raise ValueError("Unexcpected Answer %s" % response) raise ValueError("Unexcpected Answer %s" % response)
self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201) self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201)
self.portal.REQUEST.RESPONSE.setStatus(200) self.portal.REQUEST.RESPONSE.setStatus(200)
organisation = self.portal.restrictedTraverse(response['id'].encode()) organisation = self.portal.restrictedTraverse(response['id'].encode() if six.PY2 else response["id"])
self.assertEqual(organisation.getTitle(), self.id_template) self.assertEqual(organisation.getTitle(), self.id_template)
# Check Second action # Check Second action
response = json.loads(self.postToApi( response = json.loads(self.postToApi(
...@@ -664,7 +664,7 @@ return json.dumps({ ...@@ -664,7 +664,7 @@ return json.dumps({
raise ValueError("Unexcpected Answer %s" % response) raise ValueError("Unexcpected Answer %s" % response)
self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201) self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 201)
self.portal.REQUEST.RESPONSE.setStatus(200) self.portal.REQUEST.RESPONSE.setStatus(200)
person = self.portal.restrictedTraverse(response['id'].encode()) person = self.portal.restrictedTraverse(response['id'].encode() if six.PY2 else response["id"])
self.assertEqual(person.getTitle(), self.id_template) self.assertEqual(person.getTitle(), self.id_template)
def test_action_post_no_action_matches(self): def test_action_post_no_action_matches(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment