diff --git a/praw/endpoints.py b/praw/endpoints.py index c5b6006db..b0558ac8b 100644 --- a/praw/endpoints.py +++ b/praw/endpoints.py @@ -14,6 +14,10 @@ "accept_mod_invite": "r/{subreddit}/api/accept_moderator_invite", "add_subreddit_rule": "api/add_subreddit_rule", "add_whitelisted": "api/add_whitelisted", + "announcements_unread": "api/announcements/v1/unread", + "announcements_hide": "api/announcements/v1/hide", + "announcements_read": "api/announcements/v1/read", + "announcements_read_all": "api/announcements/v1/read_all", "approve": "api/approve/", "block": "api/block", "block_user": "/api/block_user/", @@ -105,7 +109,7 @@ "media_asset": "api/media/asset.json", "mentions": "message/mentions", "message": "message/messages/{id}/", - "messages": "message/messages/", + "messages": "message/messages", "mod_notes": "api/mod/notes", "mod_notes_bulk": "api/mod/notes/recent", "moderated": "user/{user}/moderated_subreddits/", diff --git a/praw/models/mod_note.py b/praw/models/mod_note.py index 23bdf54ae..5c32c3936 100644 --- a/praw/models/mod_note.py +++ b/praw/models/mod_note.py @@ -45,7 +45,7 @@ class ModNote(PRAWBase): """ - def __eq__(self, other: ModNote) -> bool: + def __eq__(self, other: ModNote | str | object) -> bool: """Return whether the other instance equals the current.""" if isinstance(other, self.__class__): return self.id == other.id diff --git a/praw/models/reddit/wikipage.py b/praw/models/reddit/wikipage.py index 4086b9561..7336ce727 100644 --- a/praw/models/reddit/wikipage.py +++ b/praw/models/reddit/wikipage.py @@ -166,8 +166,6 @@ class WikiPage(RedditBase): """ - __hash__ = RedditBase.__hash__ - @staticmethod def _revision_generator( *, diff --git a/praw/reddit.py b/praw/reddit.py index 02c01e0f1..4f69895c6 100644 --- a/praw/reddit.py +++ b/praw/reddit.py @@ -484,6 +484,7 @@ def _prepare_objector(self) -> None: self.config.kinds["submission"]: models.Submission, self.config.kinds["subreddit"]: models.Subreddit, self.config.kinds["trophy"]: models.Trophy, + # "Announcement": models.Announcement, "Button": models.Button, "Collection": models.Collection, "Draft": models.Draft, diff --git a/tests/unit/models/reddit/test_inline_media.py b/tests/unit/models/reddit/test_inline_media.py index 4dc743338..221cef099 100644 --- a/tests/unit/models/reddit/test_inline_media.py +++ b/tests/unit/models/reddit/test_inline_media.py @@ -34,7 +34,6 @@ def test_hash(self): assert hash(media2) != hash(media3) assert hash(media1) != hash(media3) - def test_pickle(self): media = InlineMedia(path="path1", caption="caption1") for level in range(pickle.HIGHEST_PROTOCOL + 1): diff --git a/tests/unit/models/reddit/test_widgets.py b/tests/unit/models/reddit/test_widgets.py index 793a12275..543398e7a 100644 --- a/tests/unit/models/reddit/test_widgets.py +++ b/tests/unit/models/reddit/test_widgets.py @@ -54,7 +54,7 @@ def test_hash(self): assert hash(widget1) == hash(widget3) -class TestWidgets(UnitTest): +class TestSubredditWidgets(UnitTest): def test_bad_attribute(self, reddit): subreddit = reddit.subreddit(pytest.placeholders.test_subreddit) widgets = subreddit.widgets