Merge pull request #27 from sneakypete81/apiv2_frontend_bugfixes
Changes due to photo/frontend album bugfix
This commit is contained in:
commit
5641ce103a
3 changed files with 6 additions and 15 deletions
|
@ -43,10 +43,7 @@ class ApiAlbum:
|
||||||
if not isinstance(album, Album):
|
if not isinstance(album, Album):
|
||||||
album = Album(self._client, {"id": album})
|
album = Album(self._client, {"id": album})
|
||||||
album.update(**kwds)
|
album.update(**kwds)
|
||||||
|
return album
|
||||||
# Don't return the album, since the API currently doesn't give us the modified album
|
|
||||||
# TODO: Uncomment the following once frontend issue #937 is resolved
|
|
||||||
# return album
|
|
||||||
|
|
||||||
def view(self, album, **kwds):
|
def view(self, album, **kwds):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -162,14 +162,8 @@ class Album(OpenPhotoObject):
|
||||||
""" Update this album with the specified parameters """
|
""" Update this album with the specified parameters """
|
||||||
new_dict = self._openphoto.post("/album/%s/update.json" % self.id,
|
new_dict = self._openphoto.post("/album/%s/update.json" % self.id,
|
||||||
**kwds)["result"]
|
**kwds)["result"]
|
||||||
|
self._replace_fields(new_dict)
|
||||||
# Since the API doesn't give us the modified album, we need to
|
self._update_fields_with_objects()
|
||||||
# update our fields based on the kwds that were sent
|
|
||||||
self._set_fields(kwds)
|
|
||||||
|
|
||||||
# Replace the above line with the below once frontend issue #937 is resolved
|
|
||||||
# self._set_fields(new_dict)
|
|
||||||
# self._update_fields_with_objects()
|
|
||||||
|
|
||||||
def view(self, **kwds):
|
def view(self, **kwds):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -69,7 +69,7 @@ class TestBase(unittest.TestCase):
|
||||||
self.photos = self.client.photos.list()
|
self.photos = self.client.photos.list()
|
||||||
if len(self.photos) != 3:
|
if len(self.photos) != 3:
|
||||||
# print self.photos
|
# print self.photos
|
||||||
print "[Regenerating Photos]"
|
print "\n[Regenerating Photos]"
|
||||||
if len(self.photos) > 0:
|
if len(self.photos) > 0:
|
||||||
self._delete_all()
|
self._delete_all()
|
||||||
self._create_test_photos()
|
self._create_test_photos()
|
||||||
|
@ -79,7 +79,7 @@ class TestBase(unittest.TestCase):
|
||||||
if (len(self.tags) != 1 or
|
if (len(self.tags) != 1 or
|
||||||
self.tags[0].id != self.TEST_TAG or
|
self.tags[0].id != self.TEST_TAG or
|
||||||
self.tags[0].count != 3):
|
self.tags[0].count != 3):
|
||||||
print "[Regenerating Tags]"
|
print "\n[Regenerating Tags]"
|
||||||
self._delete_all()
|
self._delete_all()
|
||||||
self._create_test_photos()
|
self._create_test_photos()
|
||||||
self.photos = self.client.photos.list()
|
self.photos = self.client.photos.list()
|
||||||
|
@ -92,7 +92,7 @@ class TestBase(unittest.TestCase):
|
||||||
if (len(self.albums) != 1 or
|
if (len(self.albums) != 1 or
|
||||||
self.albums[0].name != self.TEST_ALBUM or
|
self.albums[0].name != self.TEST_ALBUM or
|
||||||
self.albums[0].count != "3"):
|
self.albums[0].count != "3"):
|
||||||
print "[Regenerating Albums]"
|
print "\n[Regenerating Albums]"
|
||||||
self._delete_all()
|
self._delete_all()
|
||||||
self._create_test_photos()
|
self._create_test_photos()
|
||||||
self.photos = self.client.photos.list()
|
self.photos = self.client.photos.list()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue