From 984d5926d8bddec37e4f22d785ae41059bd48f5f Mon Sep 17 00:00:00 2001 From: Rehan Khwaja Date: Thu, 10 Nov 2016 22:42:26 -0800 Subject: [PATCH] Fix user.reviews and shelf.name --- goodreads/shelf.py | 2 +- goodreads/user.py | 2 +- tests/review_test.py | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/goodreads/shelf.py b/goodreads/shelf.py index af0d2bc..c7f45f1 100644 --- a/goodreads/shelf.py +++ b/goodreads/shelf.py @@ -8,7 +8,7 @@ def __repr__(self): @property def name(self): - return self._shelf_dict['@name'] + return self._shelf_dict['name'] @property def count(self): diff --git a/goodreads/user.py b/goodreads/user.py index 74f0901..3674592 100644 --- a/goodreads/user.py +++ b/goodreads/user.py @@ -77,7 +77,7 @@ def owned_books(self, page=1): def reviews(self, page=1): """Get all books and reviews on user's shelves""" - resp = self._client.session.get("/review/list.xml", + resp = self._client.request("/review/list.xml", {'v': 2, 'id': self.gid, 'page': page}) return [review.GoodreadsReview(r) for r in resp['reviews']['review']] diff --git a/tests/review_test.py b/tests/review_test.py index 24b4d39..3e07062 100644 --- a/tests/review_test.py +++ b/tests/review_test.py @@ -20,3 +20,9 @@ def test_review(self): review = self.client.review('2') eq_(review.gid, '2') pass + + def test_reviews(self): + # me = self.client.auth_user() + me = self.client.user(3132795) + reviews = me.reviews(page=1) + # eq_(review.gid, '2')