diff --git a/tests/test_actions.py b/tests/test_actions.py index 614bbbd4..39afbcde 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -6,9 +6,11 @@ def test_mark_movie_watched(movie): print('Marking movie watched: %s' % movie) print('View count: %s' % movie.viewCount) movie.markWatched() + movie.reload() print('View count: %s' % movie.viewCount) assert movie.viewCount == 1, 'View count 0 after watched.' movie.markUnwatched() + movie.reload() print('View count: %s' % movie.viewCount) assert movie.viewCount == 0, 'View count 1 after unwatched.' diff --git a/tests/test_mixins.py b/tests/test_mixins.py index d3c04f85..94d494a2 100644 --- a/tests/test_mixins.py +++ b/tests/test_mixins.py @@ -185,8 +185,9 @@ def edit_rating(obj): assert utils.is_datetime(obj.lastRatedAt) assert obj.userRating == 10.0 obj.rate() - obj.reload() - assert obj.lastRatedAt is None + # Cannot use obj.reload() since PlexObject.__setattr__() + # will not overwrite userRating with None + obj = obj.fetchItem(obj._details_key) assert obj.userRating is None with pytest.raises(BadRequest): assert obj.rate('bad-rating') diff --git a/tests/test_video.py b/tests/test_video.py index f769be19..9b44c99a 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -697,11 +697,13 @@ def test_video_Show_analyze(show): def test_video_Show_markWatched(show): show.markWatched() + show.reload() assert show.isWatched def test_video_Show_markUnwatched(show): show.markUnwatched() + show.reload() assert not show.isWatched @@ -814,12 +816,14 @@ def test_video_Season_show(show): def test_video_Season_watched(show): season = show.season("Season 1") season.markWatched() + season.reload() assert season.isWatched def test_video_Season_unwatched(show): season = show.season("Season 1") season.markUnwatched() + season.reload() assert not season.isWatched