Not that frontend issue 955 is resolved, we should use the return value of the transform API to replace the photo object's fields

This commit is contained in:
sneakypete81 2013-04-13 13:11:26 +01:00
parent ee3840de9f
commit ea904e4337
3 changed files with 3 additions and 17 deletions

View file

@ -111,6 +111,4 @@ class ApiPhoto:
if not isinstance(photo, Photo):
photo = Photo(self._client, {"id": photo})
photo.transform(**kwds)
# The API doesn't currently return the transformed photo
# Uncomment the below once frontend issue #955 is resolved
# return photo
return photo

View file

@ -103,9 +103,7 @@ class Photo(OpenPhotoObject):
"""
new_dict = self._openphoto.post("/photo/%s/transform.json" % self.id,
**kwds)["result"]
# The API doesn't currently return the transformed photo
# Uncomment the below once frontend issue #955 is resolved
# self._replace_fields(new_dict)
self._replace_fields(new_dict)
class Tag(OpenPhotoObject):
def delete(self, **kwds):

View file

@ -151,18 +151,8 @@ class TestPhotos(test_base.TestBase):
photo = self.photos[0]
self.assertEqual(photo.rotation, "0")
photo = self.client.photo.transform(photo, rotate=90)
# Need an explicit update, since transform API doesn't return the rotated photo
# Remove the following line once Issue #955 is resolved
photo = self.client.photo.view(self.photos[0])
self.assertEqual(photo.rotation, "90")
# Do the same using the Photo object directly
photo.transform(rotate=90)
# Need an explicit update, since transform API doesn't return the rotated photo
# Remove the following line once Issue #955 is resolved
photo = self.client.photo.view(photo)
self.assertEqual(photo.rotation, "180")