def test_fetch_photo_comments_parser(self): group = GroupFactory(remote_id=GROUP_ID) album = AlbumFactory(remote_id=ALBUM_ID, group=group) photo = PhotoFactory(remote_id=PHOTO_ID, album=album) self.assertEqual(photo.comments, 0) photo.fetch_comments_parser() self.assertTrue(photo.comments > 0)
def test_fetch_photo_likes(self): group = GroupFactory(remote_id=GROUP_ID) album = AlbumFactory(remote_id=ALBUM_ID, group=group) photo = PhotoFactory(remote_id=PHOTO_ID, album=album, group=group) self.assertEqual(photo.likes, 0) users = photo.fetch_likes(all=True) self.assertTrue(photo.likes > 0) self.assertEqual(photo.likes, len(users))
def test_fetch_photo_likes(self): group = GroupFactory.create(remote_id=GROUP_ID) album = AlbumFactory.create(remote_id=ALBUM_ID, group=group) photo = PhotoFactory.create(remote_id=PHOTO_ID, album=album) self.assertEqual(photo.likes, 0) photo.update_likes() self.assertTrue(photo.likes > 0)