diff --git a/CHANGES.rst b/CHANGES.rst index 16f08e4c0..d4b05249d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,26 @@ Unreleased - :meth:`.SubredditCollectionsModeration.create` keyword argument ``display_layout`` for specifying a display layout when creating a :class:`.Collection`. - :attr:`~.Message.parent` to get the parent of a :class:`.Message`. +- :class:`.ModNote` to represent a moderator note. +- :meth:`.ModNote.delete` to delete a single moderator note. +- :class:`.RedditModNotes` to interact with moderator notes from a :class:`.Reddit` + instance. This provides the ability to create and fetch notes for one or more + redditors from one or more subreddits. +- :class:`.RedditorModNotes` to interact with moderator notes from a :class:`.Redditor` + instance. +- :meth:`.RedditorModNotes.subreddits` to obtain moderator notes from multiple + subreddits for a single redditor. +- :class:`.SubredditModNotes` to interact with moderator notes from a + :class:`.Subreddit` instance. +- :meth:`.SubredditModNotes.redditors` to obtain moderator notes for multiple redditors + from a single subreddit. +- :meth:`~.BaseModNotes.create` to create a moderator note. +- :attr:`.Redditor.notes` to interact with :class:`.RedditorModNotes`. +- :attr:`.SubredditModeration.notes` to interact with :class:`.SubredditModNotes`. +- :meth:`~.ModNoteMixin.create_note` create a moderator note from a :class:`.Comment` or + :class:`.Submission`. +- :meth:`~.ModNoteMixin.author_notes` to view the moderator notes for the author of a + :class:`.Comment` or :class:`.Submission`. **Changed** diff --git a/docs/code_overview/other.rst b/docs/code_overview/other.rst index 68abbdf7e..747dbd259 100644 --- a/docs/code_overview/other.rst +++ b/docs/code_overview/other.rst @@ -33,6 +33,17 @@ them bound to an attribute of one of the PRAW models. other/inlinemedia other/inlinevideo +.. toctree:: + :maxdepth: 2 + :caption: ModNotes + + other/base_mod_notes + other/mod_note + other/mod_note_mixin + other/reddit_mod_notes + other/redditor_mod_notes + other/subreddit_mod_notes + .. toctree:: :maxdepth: 2 :caption: Moderation Helpers @@ -121,6 +132,7 @@ them bound to an attribute of one of the PRAW models. other/inboxablemixin other/listinggenerator other/mod_action + other/mod_note other/moderatedlist other/modmail other/modmailmessage diff --git a/docs/code_overview/other/base_mod_notes.rst b/docs/code_overview/other/base_mod_notes.rst new file mode 100644 index 000000000..9d188ec2b --- /dev/null +++ b/docs/code_overview/other/base_mod_notes.rst @@ -0,0 +1,5 @@ +BaseModNotes +============ + +.. autoclass:: praw.models.mod_notes.BaseModNotes + :inherited-members: diff --git a/docs/code_overview/other/mod_note.rst b/docs/code_overview/other/mod_note.rst new file mode 100644 index 000000000..9b19e416a --- /dev/null +++ b/docs/code_overview/other/mod_note.rst @@ -0,0 +1,5 @@ +ModNote +======= + +.. autoclass:: praw.models.ModNote + :inherited-members: diff --git a/docs/code_overview/other/mod_note_mixin.rst b/docs/code_overview/other/mod_note_mixin.rst new file mode 100644 index 000000000..8c9fa8460 --- /dev/null +++ b/docs/code_overview/other/mod_note_mixin.rst @@ -0,0 +1,5 @@ +ModNoteMixin +============ + +.. autoclass:: praw.models.reddit.mixins.ModNoteMixin + :members: diff --git a/docs/code_overview/other/reddit_mod_notes.rst b/docs/code_overview/other/reddit_mod_notes.rst new file mode 100644 index 000000000..cc28a2ef6 --- /dev/null +++ b/docs/code_overview/other/reddit_mod_notes.rst @@ -0,0 +1,5 @@ +RedditModNotes +============== + +.. autoclass:: praw.models.RedditModNotes + :inherited-members: diff --git a/docs/code_overview/other/redditor_mod_notes.rst b/docs/code_overview/other/redditor_mod_notes.rst new file mode 100644 index 000000000..0088e984c --- /dev/null +++ b/docs/code_overview/other/redditor_mod_notes.rst @@ -0,0 +1,5 @@ +RedditorModNotes +================ + +.. autoclass:: praw.models.RedditorModNotes + :inherited-members: diff --git a/docs/code_overview/other/subreddit_mod_notes.rst b/docs/code_overview/other/subreddit_mod_notes.rst new file mode 100644 index 000000000..4dd924672 --- /dev/null +++ b/docs/code_overview/other/subreddit_mod_notes.rst @@ -0,0 +1,5 @@ +SubredditModNotes +================= + +.. autoclass:: praw.models.SubredditModNotes + :inherited-members: diff --git a/praw/endpoints.py b/praw/endpoints.py index 6772a5499..104d2141f 100644 --- a/praw/endpoints.py +++ b/praw/endpoints.py @@ -108,6 +108,8 @@ "mentions": "message/mentions", "message": "message/messages/{id}/", "messages": "message/messages/", + "mod_notes": "api/mod/notes", + "mod_notes_bulk": "api/mod/notes/recent", "moderated": "user/{user}/moderated_subreddits/", "moderator_messages": "r/{subreddit}/message/moderator/", "moderator_unread": "r/{subreddit}/message/moderator/unread/", diff --git a/praw/models/__init__.py b/praw/models/__init__.py index 44a8365d8..648cc644b 100644 --- a/praw/models/__init__.py +++ b/praw/models/__init__.py @@ -11,6 +11,8 @@ from .listing.generator import ListingGenerator from .listing.listing import Listing, ModeratorListing, ModmailConversationsListing from .mod_action import ModAction +from .mod_note import ModNote +from .mod_notes import RedditModNotes, RedditorModNotes, SubredditModNotes from .preferences import Preferences from .reddit.collections import Collection from .reddit.comment import Comment diff --git a/praw/models/listing/generator.py b/praw/models/listing/generator.py index 89f9aaadd..7bd53447a 100644 --- a/praw/models/listing/generator.py +++ b/praw/models/listing/generator.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Any, Dict, Iterator, Optional, Union from ..base import PRAWBase -from .listing import FlairListing +from .listing import FlairListing, ModNoteListing if TYPE_CHECKING: # pragma: no cover import praw @@ -66,15 +66,28 @@ def __next__(self) -> Any: self.yielded += 1 return self._listing[self._list_index - 1] + def _extract_sublist(self, listing): + if isinstance(listing, list): + return listing[1] # for submission duplicates + elif isinstance(listing, dict): + classes = [FlairListing, ModNoteListing] + + for listing_type in classes: + if listing_type.CHILD_ATTRIBUTE in listing: + return listing_type(self._reddit, listing) + else: + raise ValueError( + "The generator returned a dictionary PRAW didn't recognize." + " File a bug report at PRAW." + ) + return listing + def _next_batch(self): if self._exhausted: raise StopIteration() self._listing = self._reddit.get(self.url, params=self.params) - if isinstance(self._listing, list): - self._listing = self._listing[1] # for submission duplicates - elif isinstance(self._listing, dict): - self._listing = FlairListing(self._reddit, self._listing) + self._listing = self._extract_sublist(self._listing) self._list_index = 0 if not self._listing: diff --git a/praw/models/listing/listing.py b/praw/models/listing/listing.py index 475ea3620..6c2e1cfa7 100644 --- a/praw/models/listing/listing.py +++ b/praw/models/listing/listing.py @@ -41,6 +41,19 @@ class ModeratorListing(Listing): CHILD_ATTRIBUTE = "moderators" +class ModNoteListing(Listing): + """Special Listing for handling :class:`.ModNote` lists.""" + + CHILD_ATTRIBUTE = "mod_notes" + + @property + def after(self) -> Optional[Any]: + """Return the next attribute or None.""" + if not getattr(self, "has_next_page", True): + return None + return getattr(self, "end_cursor", None) + + class ModmailConversationsListing(Listing): """Special Listing for handling :class:`.ModmailConversation` lists.""" diff --git a/praw/models/mod_note.py b/praw/models/mod_note.py new file mode 100644 index 000000000..df7a29945 --- /dev/null +++ b/praw/models/mod_note.py @@ -0,0 +1,70 @@ +"""Provide the ModNote class.""" +from praw.endpoints import API_PATH + +from .base import PRAWBase + + +class ModNote(PRAWBase): + """Represent a moderator note. + + .. include:: ../../typical_attributes.rst + + =============== ==================================================================== + Attribute Description + =============== ==================================================================== + ``action`` If this note represents a moderator action, this field indicates the + type of action. For example, ``"banuser"`` if the action was banning + a user. + ``created_at`` Time the moderator note was created, represented in `Unix Time`_. + ``description`` If this note represents a moderator action, this field indicates the + description of the action. For example, if the action was banning + the user, this is the ban reason. + ``details`` If this note represents a moderator action, this field indicates the + details of the action. For example, if the action was banning the + user, this is the duration of the ban. + ``id`` The ID of the moderator note. + ``label`` The label applied to the note, currently one of: + ``"ABUSE_WARNING"``, ``"BAN"``, ``"BOT_BAN"``, ``"HELPFUL_USER"``, + ``"PERMA_BAN"``, ``"SOLID_CONTRIBUTOR"``, ``"SPAM_WARNING"``, + ``"SPAM_WATCH"``, or ``None``. + ``moderator`` The moderator who created the note. + ``note`` The text of the note. + ``reddit_id`` The fullname of the object this note is attributed to, or ``None`` + if not set. If this note represents a moderators action, this is the + fullname of the object the action was performed on. + ``subreddit`` The subreddit this note belongs to. + ``type`` The type of note, currently one of: ``"APPROVAL"``, ``"BAN"``, + ``"CONTENT_CHANGE"``, ``"INVITE"``, ``"MUTE"``, ``"NOTE"``, + ``"REMOVAL"``, or ``"SPAM"``. + ``user`` The redditor the note is for. + =============== ==================================================================== + + .. _unix time: https://en.wikipedia.org/wiki/Unix_time + + """ + + def __eq__(self, other): + """Return whether the other instance equals the current.""" + if isinstance(other, self.__class__): + return self.id == other.id + if isinstance(other, str): + return self.id == other + return super().__eq__(other) + + def delete(self): + """Delete this note. + + For example, to delete the last note for u/spez from r/test, try: + + .. code-block:: python + + for note in reddit.subreddit("test").mod.notes("spez"): + note.delete() + + """ + params = { + "user": str(self.user), + "subreddit": str(self.subreddit), + "note_id": self.id, + } + self._reddit.delete(API_PATH["mod_notes"], params=params) diff --git a/praw/models/mod_notes.py b/praw/models/mod_notes.py new file mode 100644 index 000000000..54d451554 --- /dev/null +++ b/praw/models/mod_notes.py @@ -0,0 +1,695 @@ +"""Provides classes for interacting with moderator notes.""" +from itertools import islice +from typing import TYPE_CHECKING, Any, Generator, List, Optional, Tuple, Union + +from ..const import API_PATH +from ..models.base import PRAWBase +from ..models.listing.generator import ListingGenerator +from .reddit.comment import Comment +from .reddit.redditor import Redditor +from .reddit.submission import Submission + +if TYPE_CHECKING: # pragma: no cover + import praw + +RedditorType = Union[Redditor, str] +SubredditType = Union["praw.models.Subreddit", str] +ThingType = Union[Comment, Submission] + + +class BaseModNotes: + """Provides base methods to interact with moderator notes.""" + + def _all_generator( + self, + redditor: RedditorType, + subreddit: SubredditType, + **generator_kwargs: Any, + ): + PRAWBase._safely_add_arguments( + arguments=generator_kwargs, + key="params", + subreddit=subreddit, + user=redditor, + ) + return ListingGenerator(self._reddit, API_PATH["mod_notes"], **generator_kwargs) + + def _bulk_generator( + self, redditors: List[RedditorType], subreddits: List[SubredditType] + ) -> Generator["praw.models.ModNote", None, None]: + subreddits_iter = iter(subreddits) + redditors_iter = iter(redditors) + while True: + subreddits_chunk = list(islice(subreddits_iter, 500)) + users_chunk = list(islice(redditors_iter, 500)) + if not any([subreddits_chunk, users_chunk]): + break + params = { + "subreddits": ",".join(map(str, subreddits_chunk)), + "users": ",".join(map(str, users_chunk)), + } + response = self._reddit.get(API_PATH["mod_notes_bulk"], params=params) + for note_dict in response["mod_notes"]: + yield self._reddit._objector.objectify(note_dict) + + def _ensure_attribute(self, error_message, **attributes: Any): + attribute, _value = attributes.popitem() + value = _value or getattr(self, attribute, None) + if value is None: + raise TypeError(error_message) + return value + + def _notes( + self, + all_notes: bool, + redditors: List[RedditorType], + subreddits: List[SubredditType], + **generator_kwargs: Any, + ) -> Generator["praw.models.ModNote", None, None]: + if all_notes: + for subreddit in subreddits: + for redditor in redditors: + yield from self._all_generator( + redditor, subreddit, **generator_kwargs + ) + else: + yield from self._bulk_generator(redditors, subreddits) + + def __init__( + self, + reddit: "praw.Reddit", + ): + """Initialize a :class:`.BaseModNotes` instance. + + :param reddit: An instance of :class:`.Reddit`. + + """ + self._reddit = reddit + + def create( + self, + *, + label: Optional[str] = None, + note: str, + redditor: Optional[RedditorType] = None, + subreddit: Optional[SubredditType] = None, + thing: Optional[Union[Comment, Submission, str]] = None, + **other_settings: Any, + ) -> "praw.models.ModNote": + """Create a :class:`.ModNote` for a redditor in the specified subreddit. + + :param label: The label for the note. As of this writing, this can be one of the + following: ``"ABUSE_WARNING"``, ``"BAN"``, ``"BOT_BAN"``, + ``"HELPFUL_USER"``, ``"PERMA_BAN"``, ``"SOLID_CONTRIBUTOR"``, + ``"SPAM_WARNING"``, ``"SPAM_WATCH"``, or ``None`` (default: ``None``). + :param note: The content of the note. As of this writing, this is limited to 250 + characters. + :param redditor: The redditor to create the note for (default: ``None``). + + .. note:: + + This parameter is required if ``thing`` is not provided or this is not + called from a :class:`.Redditor` instance (e.g., + ``reddit.redditor.notes``). + + :param subreddit: The subreddit associated with the note (default: ``None``). + + .. note:: + + This parameter is required if ``thing`` is not provided or this is not + called from a :class:`.Subreddit` instance (e.g., + ``reddit.subreddit.mod``). + + :param thing: Either the fullname of a comment/submission, a :class:`.Comment`, + or a :class:`.Submission` to associate with the note. + :param other_settings: Additional keyword arguments can be provided to handle + new parameters as Reddit introduces them. + + :returns: The new :class:`.ModNote` object. + + For example, to create a note for u/spez in r/test: + + .. code-block:: python + + reddit.subreddit("test").mod.notes.create( + label="HELPFUL_USER", note="Test note", redditor="spez" + ) + # or + reddit.redditor("spez").mod.notes.create( + label="HELPFUL_USER", note="Test note", subreddit="test" + ) + # or + reddit.notes.create( + label="HELPFUL_USER", note="Test note", redditor="spez", subreddit="test" + ) + + """ + reddit_id = None + if thing: + if isinstance(thing, str): + reddit_id = thing + # this is to minimize the number of requests + if not ( + getattr(self, "redditor", redditor) + and getattr(self, "subreddit", subreddit) + ): + # only fetch if we are missing either redditor or subreddit + thing = next(self._reddit.info(fullnames=[thing])) + else: + reddit_id = thing.fullname + redditor = getattr(self, "redditor", redditor) or thing.author + subreddit = getattr(self, "subreddit", subreddit) or thing.subreddit + redditor = self._ensure_attribute( + "Either the `redditor` or `thing` parameters must be provided or this" + " method must be called from a Redditor instance (e.g., `redditor.notes`).", + redditor=redditor, + ) + subreddit = self._ensure_attribute( + "Either the `subreddit` or `thing` parameters must be provided or this" + " method must be called from a Subreddit instance (e.g.," + " `subreddit.mod.notes`).", + subreddit=subreddit, + ) + data = { + "user": str(redditor), + "subreddit": str(subreddit), + "note": note, + } + if label: + data["label"] = label + if reddit_id: + data["reddit_id"] = reddit_id + data.update(other_settings) + return self._reddit.post(API_PATH["mod_notes"], data=data) + + def delete( + self, + *, + delete_all: bool = False, + note_id: Optional[str] = None, + redditor: Optional[RedditorType] = None, + subreddit: Optional[SubredditType] = None, + ): + """Delete note(s) for a redditor. + + :param delete_all: When ``True``, delete all notes for the specified redditor in + the specified subreddit (default: ``False``). + + .. note:: + + This will make a request for each note. + + :param note_id: The ID of the note to delete. This parameter is ignored if + ``delete_all`` is ``True``. + :param redditor: The redditor to delete the note(s) for (default: ``None``). Can + be a :class:`.Redditor` instance or a redditor name. + + .. note:: + + This parameter is required if this method is **not** called from a + :class:`.Redditor` instance (e.g., ``redditor.notes``). + + :param subreddit: The subreddit to delete the note(s) from (default: ``None``). + Can be a :class:`.Subreddit` instance or a subreddit name. + + .. note:: + + This parameter is required if this method is **not** called from a + :class:`.Subreddit` instance (e.g., ``reddit.subreddit.mod``). + + + For example, to delete a note with the ID + ``"ModNote_d324b280-5ecc-435d-8159-3e259e84e339"``, try: + + .. code-block:: python + + reddit.subreddit("test").mod.notes.delete( + note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", redditor="spez" + ) + # or + reddit.redditor("spez").notes.delete( + note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", subreddit="test" + ) + # or + reddit.notes.delete( + note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", + subreddit="test", + redditor="spez", + ) + + To delete all notes for u/spez, try: + + .. code-block:: python + + reddit.subreddit("test").mod.notes.delete(delete_all=True, redditor="spez") + # or + reddit.redditor("spez").notes.delete(delete_all=True, subreddit="test") + # or + reddit.notes.delete(delete_all=True, subreddit="test", redditor="spez") + + """ + redditor = self._ensure_attribute( + "Either the `redditor` parameter must be provided or this method must be called" + " from a Redditor instance (e.g., `redditor.notes`).", + redditor=redditor, + ) + subreddit = self._ensure_attribute( + "Either the `subreddit` parameter must be provided or this method must be called" + " from a Subreddit instance (e.g., `subreddit.mod.notes`).", + subreddit=subreddit, + ) + if not delete_all and note_id is None: + raise TypeError("Either `note_id` or `delete_all` must be provided.") + if delete_all: + for note in self._notes(True, [redditor], [subreddit]): + note.delete() + else: + params = { + "user": str(redditor), + "subreddit": str(subreddit), + "note_id": note_id, + } + self._reddit.delete(API_PATH["mod_notes"], params=params) + + +class RedditModNotes(BaseModNotes): + """Provides methods to interact with moderator notes at a global level. + + .. note:: + + The authenticated user must be a moderator of the provided subreddit(s). + + For example, the latest note for u/spez in r/redditdev and r/test, and for u/bboe in + r/redditdev can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("bboe") + subreddit = reddit.subreddit("redditdev") + + pairs = [(subreddit, "spez"), ("test", "spez"), (subreddit, redditor)] + + for note in reddit.notes(pairs=pairs): + print(f"{note.label}: {note.note}") + + """ + + def __call__( + self, + *, + all_notes: bool = False, + pairs: Optional[List[Tuple[SubredditType, RedditorType]]] = None, + redditors: Optional[List[RedditorType]] = None, + subreddits: Optional[List[SubredditType]] = None, + things: Optional[List[ThingType]] = None, + **generator_kwargs: Any, + ) -> Generator["praw.models.ModNote", None, None]: + """Get note(s) for each subreddit/user pair, or ``None`` if they don't have any. + + :param all_notes: Whether to return all notes or only the latest note for each + subreddit/redditor pair (default: ``False``). + + .. note:: + + Setting this to ``True`` will result in a request for each unique + subreddit/redditor pair. If ``subreddits`` and ``redditors`` are + provided, this will make a request equivalent to number of redditors + multiplied by the number of subreddits. + + :param pairs: A list of subreddit/redditor tuples. + + .. note:: + + Required if ``subreddits``, ``redditors``, nor ``things`` are provided. + + :param redditors: A list of redditors to return notes for. This parameter is + used in tandem with ``subreddits`` to get notes from multiple subreddits for + each of the provided redditors. + + .. note:: + + Required if ``items`` or ``things`` is not provided or if ``subreddits`` + **is** provided. + + :param subreddits: A list of subreddits to return notes for. This parameter is + used in tandem with ``redditors`` to get notes for multiple redditors from + each of the provided subreddits. + + .. note:: + + Required if ``items`` or ``things`` is not provided or if ``redditors`` + **is** provided. + + :param things: A list of comments and/or submissions to return notes for. + :param generator_kwargs: Additional keyword arguments passed to the generator. + This parameter is ignored when ``all_notes`` is ``False``. + + :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` + if the user doesn't have any notes) per entry in their relative order. If + ``all_notes`` is ``True``, this will yield all notes for each entry. + + .. note:: + + This method will merge the subreddits and redditors provided from ``pairs``, + ``redditors``, ``subreddits``, and ``things``. + + .. note:: + + This method accepts :class:`.Redditor` instances or redditor names and + :class:`.Subreddit` instances or subreddit names where applicable. + + For example, the latest note for u/spez in r/redditdev and r/test, and for + u/bboe in r/redditdev can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("bboe") + subreddit = reddit.subreddit("redditdev") + + pairs = [(subreddit, "spez"), ("test", "spez"), (subreddit, redditor)] + + for note in reddit.notes(pairs=pairs): + print(f"{note.label}: {note.note}") + + For example, **all** the notes for u/spez and u/bboe in r/announcements, + r/redditdev, and r/test can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("bboe") + subreddit = reddit.subreddit("redditdev") + + for note in reddit.notes( + redditors=["spez", redditor], + subreddits=["announcements", subreddit, "test"], + all_notes=True, + ): + print(f"{note.label}: {note.note}") + + For example, the latest note for the authors of the last 5 comments and + submissions from r/test can be iterated through like so: + + .. code-block:: python + + submissions = list(reddit.subreddit("test").new(limit=5)) + comments = list(reddit.subreddit("test").comments(limit=5)) + + for note in reddit.notes(things=submissions + comments): + print(f"{note.label}: {note.note}") + + .. note:: + + Setting ``all_notes`` to ``True`` will make a request for each redditor and + subreddit combination. The previous example will make 6 requests. + + """ + if pairs is None: + pairs = [] + if redditors is None: + redditors = [] + if subreddits is None: + subreddits = [] + if things is None: + things = [] + if not (pairs + redditors + subreddits + things): + raise TypeError( + "Either the `pairs`, `redditors`, `subreddits`, or `things` parameters" + " must be provided." + ) + if ( + len(redditors) * len(subreddits) == 0 + and len(redditors) + len(subreddits) > 0 + ): + raise TypeError( + "`redditors` must be non-empty if `subreddits` is not empty." + if len(subreddits) > 0 + else "`subreddits` must be non-empty if `redditors` is not empty." + ) + + merged_redditors = [] + merged_subreddits = [] + items = ( + pairs + + [ + (subreddit, redditor) + for redditor in set(redditors) + for subreddit in set(subreddits) + ] + + things + ) + + for item in items: + if isinstance(item, (Comment, Submission)): + merged_redditors.append(item.author.name) + merged_subreddits.append(item.subreddit.display_name) + elif isinstance(item, Tuple): + subreddit, redditor = item + merged_redditors.append(redditor) + merged_subreddits.append(subreddit) + else: + raise ValueError( + f"Cannot get subreddit and author fields from type {type(item)}" + ) + return self._notes( + all_notes, merged_redditors, merged_subreddits, **generator_kwargs + ) + + def things( + self, + *things: ThingType, + all_notes: Optional[bool] = None, + **generator_kwargs: Any, + ) -> Generator["praw.models.ModNote", None, None]: + """Return notes associated with the author of a :class:`.Comment` or :class:`.Submission`. + + :param things: One or more things to return notes on. Must be a + :class:`.Comment` or :class:`.Submission`. + :param all_notes: Whether to return all notes, or only the latest (default: + ``True`` if only one thing is provided otherwise ``False``). + + .. note:: + + Setting this to ``True`` will result in a request for each thing. + + + :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` + if the user doesn't have any notes) per entry in their relative order. If + ``all_notes`` is ``True``, this will yield all notes for each entry. + + For example, to get the latest note for the authors of the top 25 submissions in + r/test: + + .. code-block:: python + + submissions = reddit.subreddit("test").top(limit=25) + for note in reddit.notes.things(*submissions): + print(f"{note.label}: {note.note}") + + For example, to get the latest note for the authors of the last 25 comments in + r/test: + + .. code-block:: python + + comments = reddit.subreddit("test").comments(limit=25) + for note in reddit.notes.things(*comments): + print(f"{note.label}: {note.note}") + + """ + subreddits = [] + redditors = [] + for thing in things: + subreddits.append(thing.subreddit) + redditors.append(thing.author) + if all_notes is None: + all_notes = len(things) == 1 + return self._notes(all_notes, redditors, subreddits, **generator_kwargs) + + +class RedditorModNotes(BaseModNotes): + """Provides methods to interact with moderator notes at the redditor level. + + .. note:: + + The authenticated user must be a moderator of the provided subreddit(s). + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("spez") + + for note in redditor.notes.subreddits("test"): + print(f"{note.label}: {note.note}") + + """ + + def __init__(self, reddit: "praw.Reddit", redditor: RedditorType): + """Initialize a :class:`.RedditorModNotes` instance. + + :param reddit: An instance of :class:`.Reddit`. + :param redditor: An instance of :class:`.Redditor`. + + """ + super().__init__(reddit) + self.redditor = redditor + + def subreddits( + self, + *subreddits: SubredditType, + all_notes: Optional[bool] = None, + **generator_kwargs: Any, + ) -> Generator["praw.models.ModNote", None, None]: + """Return notes for this :class:`.Redditor` from one or more subreddits. + + :param subreddits: One or more subreddits to retrieve the notes from. Must be + either a :class:`.Subreddit` or a subreddit name. + :param all_notes: Whether to return all notes or only the latest note (default: + ``True`` if only one subreddit is provided otherwise ``False``). + + .. note:: + + Setting this to ``True`` will result in a request for each subreddit. + + + :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` + if this redditor doesn't have any notes) per subreddit in their relative + order. If ``all_notes`` is ``True``, this will yield all notes or ``None`` + from each subreddit for this redditor. + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("spez") + + for note in redditor.notes.subreddits("test"): + print(f"{note.label}: {note.note}") + + For example, the latest note for u/spez from r/test and r/redditdev can be + iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("spez") + subreddit = reddit.subreddit("redditdev") + + for note in redditor.notes.subreddits("test", subreddit): + print(f"{note.label}: {note.note}") + + For example, **all** the notes for u/spez in r/test and r/redditdev can be + iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("spez") + subreddit = reddit.subreddit("redditdev") + + for note in redditor.notes.subreddits("test", subreddit, all_notes=True): + print(f"{note.label}: {note.note}") + + """ + if len(subreddits) == 0: + raise ValueError("At least 1 subreddit must be provided.") + if all_notes is None: + all_notes = len(subreddits) == 1 + return self._notes( + all_notes, + [self.redditor] * len(subreddits), + list(subreddits), + **generator_kwargs, + ) + + +class SubredditModNotes(BaseModNotes): + """Provides methods to interact with moderator notes at the subreddit level. + + .. note:: + + The authenticated user must be a moderator of this subreddit. + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + subreddit = reddit.subreddit("test") + + for note in subreddit.mod.notes.redditors("spez"): + print(f"{note.label}: {note.note}") + + """ + + def __init__(self, reddit: "praw.Reddit", subreddit: SubredditType): + """Initialize a :class:`.SubredditModNotes` instance. + + :param reddit: An instance of :class:`.Reddit`. + :param subreddit: An instance of :class:`.Subreddit`. + + """ + super().__init__(reddit) + self.subreddit = subreddit + + def redditors( + self, + *redditors: RedditorType, + all_notes: Optional[bool] = None, + **generator_kwargs: Any, + ) -> Generator["praw.models.ModNote", None, None]: + """Return notes from this :class:`.Subreddit` for one or more redditors. + + :param redditors: One or more redditors to retrieve notes for. Must be either a + :class:`.Redditor` or a redditor name. + :param all_notes: Whether to return all notes or only the latest note (default: + ``True`` if only one redditor is provided otherwise ``False``). + + .. note:: + + Setting this to ``True`` will result in a request for each redditor. + + + :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` + if the user doesn't have any notes in this subreddit) per redditor in their + relative order. If ``all_notes`` is ``True``, this will yield all notes for + each redditor. + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + subreddit = reddit.subreddit("test") + + for note in subreddit.mod.notes.redditors("spez"): + print(f"{note.label}: {note.note}") + + For example, the latest note for u/spez and u/bboe from r/test can be iterated + through like so: + + .. code-block:: python + + subreddit = reddit.subreddit("test") + redditor = reddit.redditor("bboe") + + for note in subreddit.mod.notes.redditors("spez", redditor): + print(f"{note.label}: {note.note}") + + For example, **all** the notes for both u/spez and u/bboe in r/test can be + iterated through like so: + + .. code-block:: python + + subreddit = reddit.subreddit("test") + redditor = reddit.redditor("bboe") + + for note in subreddit.mod.notes.redditors("spez", redditor, all_notes=True): + print(f"{note.label}: {note.note}") + + """ + if len(redditors) == 0: + raise ValueError("At least 1 redditor must be provided.") + if all_notes is None: + all_notes = len(redditors) == 1 + return self._notes( + all_notes, + list(redditors), + [self.subreddit] * len(redditors), + **generator_kwargs, + ) diff --git a/praw/models/reddit/mixins/__init__.py b/praw/models/reddit/mixins/__init__.py index 8c357d0d0..ebf1b5329 100644 --- a/praw/models/reddit/mixins/__init__.py +++ b/praw/models/reddit/mixins/__init__.py @@ -10,6 +10,7 @@ from .inboxable import InboxableMixin from .inboxtoggleable import InboxToggleableMixin from .messageable import MessageableMixin +from .modnote import ModNoteMixin from .replyable import ReplyableMixin from .reportable import ReportableMixin from .savable import SavableMixin @@ -19,7 +20,7 @@ import praw -class ThingModerationMixin: +class ThingModerationMixin(ModNoteMixin): r"""Provides moderation methods for :class:`.Comment`\ s and :class:`.Submission`\ s.""" REMOVAL_MESSAGE_API = None diff --git a/praw/models/reddit/mixins/modnote.py b/praw/models/reddit/mixins/modnote.py new file mode 100644 index 000000000..2573a5e2f --- /dev/null +++ b/praw/models/reddit/mixins/modnote.py @@ -0,0 +1,58 @@ +"""Provide the ModNoteMixin class.""" +from typing import TYPE_CHECKING, Generator, Optional + +if TYPE_CHECKING: # pragma: no cover + import praw + + +class ModNoteMixin: + """Interface for classes that can have a moderator note set on them.""" + + def create_note( + self, *, label: Optional[str] = None, note: str, **other_settings + ) -> "praw.models.ModNote": + """Create a moderator note on the author of this object in the subreddit it's posted in. + + :param label: The label for the note. As of this writing, this can be one of the + following: ``"ABUSE_WARNING"``, ``"BAN"``, ``"BOT_BAN"``, + ``"HELPFUL_USER"``, ``"PERMA_BAN"``, ``"SOLID_CONTRIBUTOR"``, + ``"SPAM_WARNING"``, ``"SPAM_WATCH"``, or ``None`` (default: ``None``). + :param note: The content of the note. As of this writing, this is limited to 250 + characters. + :param other_settings: Additional keyword arguments are passed to + :meth:`~.BaseModNotes.create`. + + :returns: The new :class:`.ModNote` object. + + For example, to create a note on a :class:`.Submission`, try: + + .. code-block:: python + + reddit.submission("92dd8").mod.create_note(label="HELPFUL_USER", note="Test note") + + """ + return self.thing.subreddit.mod.notes.create( + label=label, note=note, thing=self.thing, **other_settings + ) + + def author_notes( + self, **generator_kwargs + ) -> Generator["praw.models.ModNote", None, None]: + """Get the moderator notes for the author of this object in the subreddit it's posted in. + + :param generator_kwargs: Additional keyword arguments are passed in the + initialization of the moderator note generator. + + :returns: A generator of :class:`.ModNote`. + + For example, to list all notes the author of a submission, try: + + .. code-block:: python + + for note in reddit.submission("92dd8").mod.author_notes(): + print(f"{note.label}: {note.note}") + + """ + return self.thing.subreddit.mod.notes.redditors( + self.thing.author, **generator_kwargs + ) diff --git a/praw/models/reddit/redditor.py b/praw/models/reddit/redditor.py index 4f94cabd4..fe70e113d 100644 --- a/praw/models/reddit/redditor.py +++ b/praw/models/reddit/redditor.py @@ -80,6 +80,30 @@ def from_data(cls, reddit, data): return None return cls(reddit, data) + @cachedproperty + def notes(self) -> "praw.models.RedditorModNotes": + """Provide an instance of :class:`.RedditorModNotes`. + + This provides an interface for managing moderator notes for a redditor. + + .. note:: + + The authenticated user must be a moderator of the provided subreddit(s). + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("spez") + + for note in redditor.notes.subreddits("test"): + print(f"{note.label}: {note.note}") + + """ + from ..mod_notes import RedditorModNotes + + return RedditorModNotes(self._reddit, self) + @cachedproperty def stream(self) -> "praw.models.reddit.redditor.RedditorStream": """Provide an instance of :class:`.RedditorStream`. diff --git a/praw/models/reddit/submission.py b/praw/models/reddit/submission.py index f0ec6ccf9..7077095e5 100644 --- a/praw/models/reddit/submission.py +++ b/praw/models/reddit/submission.py @@ -12,7 +12,7 @@ from ..listing.listing import Listing from ..listing.mixins import SubmissionListingMixin from .base import RedditBase -from .mixins import FullnameMixin, ThingModerationMixin, UserContentMixin +from .mixins import FullnameMixin, ModNoteMixin, ThingModerationMixin, UserContentMixin from .poll import PollData from .redditor import Redditor from .subreddit import Subreddit @@ -77,7 +77,7 @@ def select(self, flair_template_id: str, *, text: Optional[str] = None): self.submission._reddit.post(url, data=data) -class SubmissionModeration(ThingModerationMixin): +class SubmissionModeration(ThingModerationMixin, ModNoteMixin): """Provide a set of functions pertaining to :class:`.Submission` moderation. Example usage: diff --git a/praw/models/reddit/subreddit.py b/praw/models/reddit/subreddit.py index b4594d245..0a0df6966 100644 --- a/praw/models/reddit/subreddit.py +++ b/praw/models/reddit/subreddit.py @@ -351,7 +351,7 @@ def flair(self) -> "praw.models.reddit.subreddit.SubredditFlair": return SubredditFlair(self) @cachedproperty - def mod(self) -> "praw.models.reddit.subreddit.SubredditModeration": + def mod(self) -> "SubredditModeration": """Provide an instance of :class:`.SubredditModeration`. For example, to accept a moderation invite from r/test: @@ -2301,6 +2301,26 @@ def _handle_only(*, generator_kwargs: Dict[str, Any], only: Optional[str]): arguments=generator_kwargs, key="params", only=only ) + @cachedproperty + def notes(self) -> "praw.models.SubredditModNotes": + """Provide an instance of :class:`.SubredditModNotes`. + + This provides an interface for managing moderator notes for this subreddit. + + For example, all the notes for u/spez in r/test can be iterated through like so: + + .. code-block:: python + + subreddit = reddit.subreddit("test") + + for note in subreddit.mod.notes.redditors("spez"): + print(f"{note.label}: {note.note}") + + """ + from ..mod_notes import SubredditModNotes + + return SubredditModNotes(self.subreddit._reddit, subreddit=self.subreddit) + def __init__(self, subreddit: "praw.models.Subreddit"): """Initialize a :class:`.SubredditModeration` instance. diff --git a/praw/objector.py b/praw/objector.py index a95b10483..220d1dc89 100644 --- a/praw/objector.py +++ b/praw/objector.py @@ -186,6 +186,23 @@ def _objectify_dict(self, data): draft["modified"] / 1000 ).astimezone() parser = self.parsers["DraftList"] + elif {"mod_action_data", "user_note_data"}.issubset(data): + data["moderator"] = self._reddit.redditor(data["operator"]) + data["subreddit"] = self._reddit.subreddit(data["subreddit"]) + data["user"] = self._reddit.redditor(data["user"]) + # move these sub dict values into the main dict for simplicity + data.update(data["mod_action_data"]) + del data["mod_action_data"] + data.update(data["user_note_data"]) + del data["user_note_data"] + parser = self.parsers["mod_note"] + elif ( + "created" in data + and isinstance(data["created"], dict) + and {"mod_action_data", "user_note_data"}.issubset(data["created"]) + ): + data = data["created"] + return self._objectify_dict(data) else: if "user" in data: parser = self.parsers[self._reddit.config.kinds["redditor"]] diff --git a/praw/reddit.py b/praw/reddit.py index f7fd7c279..7260752eb 100644 --- a/praw/reddit.py +++ b/praw/reddit.py @@ -351,6 +351,31 @@ def request(self, *args, **kwargs): """ + self.notes = models.RedditModNotes(self) + r"""An instance of :class:`.RedditModNotes`. + + Provides the interface for working with :class:`.ModNote`\ s for multiple + redditors across multiple subreddits. + + .. note:: + + The authenticated user must be a moderator of the provided subreddit(s). + + For example, the latest note for u/spez in r/redditdev and r/test, and for + u/bboe in r/redditdev can be iterated through like so: + + .. code-block:: python + + redditor = reddit.redditor("bboe") + subreddit = reddit.subreddit("redditdev") + + pairs = [(subreddit, "spez"), ("test", "spez"), (subreddit, redditor)] + + for note in reddit.notes(pairs=pairs): + print(f"{note.label}: {note.note}") + + """ + self.redditors = models.Redditors(self, None) """An instance of :class:`.Redditors`. @@ -512,6 +537,7 @@ def _prepare_objector(self): "modaction": models.ModAction, "moderator-list": models.ModeratorListing, "moderators": models.ModeratorsWidget, + "mod_note": models.ModNote, "more": models.MoreComments, "post-flair": models.PostFlairWidget, "rule": models.Rule, diff --git a/tests/integration/cassettes/TestComment.test_notes.json b/tests/integration/cassettes/TestComment.test_notes.json new file mode 100644 index 000000000..1c544062a --- /dev/null +++ b/tests/integration/cassettes/TestComment.test_notes.json @@ -0,0 +1,415 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-05-01T23:12:59", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"refresh_token\": \"\", \"scope\": \"creddits modnote modcontributors modmail modconfig subscribe structuredstyles vote wikiedit mysubreddits submit modlog modposts modflair save modothers adsconversions read privatemessages report identity livemanage account modtraffic wikiread edit modwiki modself flair history\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Cache-Control": [ + "private, max-age=3600" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "454" + ], + "Date": [ + "Sun, 01 May 2022 23:12:59 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=bo3JlKeDAhQ1M8QdZL; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "421" + ], + "x-ratelimit-used": [ + "1" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-05-01T23:12:59", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=bo3JlKeDAhQ1M8QdZL" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/info/?id=t1_i6yklz7&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"subreddit_id\": \"t5_29ey0j\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"edited\": false, \"mod_reason_by\": null, \"banned_by\": null, \"ups\": 1, \"num_reports\": 0, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"\", \"author_flair_template_id\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"i6yklz7\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"gildings\": {}, \"send_replies\": true, \"parent_id\": \"t3_uflrmv\", \"score\": 1, \"author_fullname\": \"t2_75u2lqkb\", \"created_utc\": 1651444641.0, \"report_reasons\": [], \"approved_by\": null, \"all_awardings\": [], \"ignore_reports\": false, \"body\": \"test reply\", \"awarders\": [], \"top_awarded_type\": null, \"downs\": 0, \"author_flair_css_class\": null, \"author_patreon_flair\": false, \"collapsed\": false, \"author_flair_richtext\": [], \"is_submitter\": true, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest reply\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"removal_reason\": null, \"collapsed_reason\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"removed\": false, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r//comments/uflrmv/test_post/i6yklz7/\", \"subreddit_type\": \"public\", \"locked\": false, \"name\": \"t1_i6yklz7\", \"created\": 1651444641.0, \"author_flair_text\": null, \"treatment_tags\": [], \"author\": \"Lil_SpazTest\", \"link_id\": \"t3_uflrmv\", \"subreddit_name_prefixed\": \"r/\", \"controversiality\": 0, \"author_flair_background_color\": null, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"mod_note\": null, \"distinguished\": null}}], \"before\": null}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "1956" + ], + "Date": [ + "Sun, 01 May 2022 23:12:59 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFA3V2M3T2xhU2M4NnpvS21kbWJSckNNOUV2eGcyYVo5c1B2czBlakVLLUdHX2VFYzkyS3NMRzNqUllKS2VzMWpRZHZscjM4ektVN0VjbklGZkRoVGZoLXFaUFJ0X2VKU0l3ZTJYZ0llSHI1VVZHdHFuZEU2R3Y1NFFGdTllR0xuQ0s; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 30-Apr-2024 23:12:59 GMT; secure; SameSite=None; Secure", + "session_tracker=qohdrqiqbbhghpocbn.0.1651446779398.Z0FBQUFBQmlieFA3Wi1QbUpKZzhrMFFTVE9qMlB2QWZHM0J4ejZXSVRkdHkwWHFXeFJ0RGdJVXB1ZlUwNzhUaThfZ2s2dEZaZVEzYzh2aWpZVVlpODJEUFFlcDl6akF0VUdvZmJxYkJpUW9SMGRuOHBPVHdKUlNTaVlCeVJ4RDNuZVZVNHQ3RExHMWs; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:12:59 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 30-Apr-2025 23:12:59 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "421" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/info/?id=t1_i6yklz7&raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T23:12:59", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json&label=HELPFUL_USER¬e=test+note&reddit_id=t1_i6yklz7&subreddit=&user=Lil_SpazTest" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "104" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "csv=2; edgebucket=bo3JlKeDAhQ1M8QdZL; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFA3V2M3T2xhU2M4NnpvS21kbWJSckNNOUV2eGcyYVo5c1B2czBlakVLLUdHX2VFYzkyS3NMRzNqUllKS2VzMWpRZHZscjM4ektVN0VjbklGZkRoVGZoLXFaUFJ0X2VKU0l3ZTJYZ0llSHI1VVZHdHFuZEU2R3Y1NFFGdTllR0xuQ0s; redesign_optout=true; session_tracker=qohdrqiqbbhghpocbn.0.1651446779398.Z0FBQUFBQmlieFA3Wi1QbUpKZzhrMFFTVE9qMlB2QWZHM0J4ejZXSVRkdHkwWHFXeFJ0RGdJVXB1ZlUwNzhUaThfZ2s2dEZaZVEzYzh2aWpZVVlpODJEUFFlcDl6akF0VUdvZmJxYkJpUW9SMGRuOHBPVHdKUlNTaVlCeVJ4RDNuZVZVNHQ3RExHMWs" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t1_i6yklz7\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_4a31835b-658e-4fea-8cee-429a41276cd4\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t1_i6yklz7\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651446779, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "463" + ], + "Date": [ + "Sun, 01 May 2022 23:12:59 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=qohdrqiqbbhghpocbn.0.1651446779538.Z0FBQUFBQmlieFA3OE9nd244T0FOMmpFU1JPeE9XS0cxSFRvVG5YbnUwV1FjWHZoN2RyYmtBX1pXdVJtYTRValpKZkxGVEwxcWx4VkVwRk0tWlNISFEzdlpzQ2JpeDMxWWctVzhnMHpKRHdHVU9tUlRIcGNzOWxHd0hUVlZydHRUWGRtTzBjYzB0Zno; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:12:59 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "598.0" + ], + "x-ratelimit-reset": [ + "421" + ], + "x-ratelimit-used": [ + "2" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T23:12:59", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=bo3JlKeDAhQ1M8QdZL; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFA3V2M3T2xhU2M4NnpvS21kbWJSckNNOUV2eGcyYVo5c1B2czBlakVLLUdHX2VFYzkyS3NMRzNqUllKS2VzMWpRZHZscjM4ektVN0VjbklGZkRoVGZoLXFaUFJ0X2VKU0l3ZTJYZ0llSHI1VVZHdHFuZEU2R3Y1NFFGdTllR0xuQ0s; redesign_optout=true; session_tracker=qohdrqiqbbhghpocbn.0.1651446779538.Z0FBQUFBQmlieFA3OE9nd244T0FOMmpFU1JPeE9XS0cxSFRvVG5YbnUwV1FjWHZoN2RyYmtBX1pXdVJtYTRValpKZkxGVEwxcWx4VkVwRk0tWlNISFEzdlpzQ2JpeDMxWWctVzhnMHpKRHdHVU9tUlRIcGNzOWxHd0hUVlZydHRUWGRtTzBjYzB0Zno" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Lil_SpazTest&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t1_i6yklz7\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_4a31835b-658e-4fea-8cee-429a41276cd4\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t1_i6yklz7\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651446779, \"cursor\": \"MTY1MTQ0Njc3OTU2Mg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_c5fe5eb8-e7a2-43d7-9e74-29aa8e7aabef\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444166, \"cursor\": \"MTY1MTQ0NDE2NjI5NQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_46c71397-75cf-4e65-bc1a-47dc783736d8\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444076, \"cursor\": \"MTY1MTQ0NDA3NjI0Nw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_5362e80d-e2db-4f44-a7bf-0d635d02d506\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651361095, \"cursor\": \"MTY1MTM2MTA5NTE2MQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_656bc570-d2eb-46f6-8915-2a818f6d056d\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360720, \"cursor\": \"MTY1MTM2MDcyMDIxMQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_59f79e52-0841-41ed-81d8-5f220d2080a4\", \"user_note_data\": {\"note\": \"test\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360508, \"cursor\": \"MTY1MTM2MDUwODk2MQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_1c2829ed-8398-4009-86c4-43009a2ff02c\", \"user_note_data\": {\"note\": \"test\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360459, \"cursor\": \"MTY1MTM2MDQ1OTkyMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_2d06bbeb-eb8f-40a1-a306-18572302c9fb\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360253, \"cursor\": \"MTY1MTM2MDI1MzU3Ng==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY1MTQ0Njc3OTU2Mg==\", \"end_cursor\": \"MTY1MTM2MDI1MzU3Ng==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "3967" + ], + "Date": [ + "Sun, 01 May 2022 23:12:59 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=qohdrqiqbbhghpocbn.0.1651446779687.Z0FBQUFBQmlieFA3N2M5dUxNclFaMkd5WnNoY05fSk9VNzNHcUhwenFZWllMMk5zNnhGNHhzRktGZUpVNXhXWkhpbnU1cFZWdVNINDNab210ak9OOEtkbmhyeWY0TDJvMk9NSFM4S1Z6ZzFYNWcwcnRJYjhSSURROXBiRHBnWXZ6UHBNdGNadG10cDI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:12:59 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "597.0" + ], + "x-ratelimit-reset": [ + "421" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Lil_SpazTest&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestModNotes.test_create_note__submission.json b/tests/integration/cassettes/TestModNotes.test_create_note__submission.json new file mode 100644 index 000000000..b2cf7047d --- /dev/null +++ b/tests/integration/cassettes/TestModNotes.test_create_note__submission.json @@ -0,0 +1,314 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-05-01T22:27:55", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"refresh_token\": \"\", \"scope\": \"creddits modnote modcontributors modmail modconfig subscribe structuredstyles vote wikiedit mysubreddits submit modlog modposts modflair save modothers adsconversions read privatemessages report identity livemanage account modtraffic wikiread edit modwiki modself flair history\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Cache-Control": [ + "private, max-age=3600" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "454" + ], + "Date": [ + "Sun, 01 May 2022 22:27:55 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=99FHjDW5wEUtJkDz81; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "297" + ], + "x-ratelimit-reset": [ + "125" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-05-01T22:27:55", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=99FHjDW5wEUtJkDz81" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": null, \"subreddit\": \"\", \"selftext\": \"\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test post\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_uflrmv\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"author_fullname\": \"t2_75u2lqkb\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": null, \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": null, \"previous_visits\": [1651360399.0, 1651442416.0], \"author_flair_richtext\": [], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1651358011.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": null, \"likes\": null, \"suggested_sort\": \"top\", \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": null, \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_29ey0j\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": 0, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"uflrmv\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Lil_SpazTest\", \"discussion_type\": null, \"num_comments\": 1, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": false, \"author_flair_text_color\": null, \"permalink\": \"/r//comments/uflrmv/test_post/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/uflrmv/test_post/\", \"subreddit_subscribers\": 2, \"created_utc\": 1651358011.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_29ey0j\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"\", \"removed\": false, \"author_flair_template_id\": null, \"likes\": true, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"i6yfrww\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"author\": \"\", \"rte_mode\": \"markdown\", \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_uflrmv\", \"score\": 1, \"author_fullname\": \"t2_o77bz\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"hi\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": null, \"name\": \"t1_i6yfrww\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Ehi\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": true, \"can_gild\": false, \"link_id\": \"t3_uflrmv\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r//comments/uflrmv/test_post/i6yfrww/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1651442460.0, \"author_flair_text\": null, \"treatment_tags\": [], \"spam\": false, \"created_utc\": 1651442460.0, \"subreddit_name_prefixed\": \"r/\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4804" + ], + "Date": [ + "Sun, 01 May 2022 22:27:56 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlid2xzQnZGSUtYQ0VTd2dVcWZUM080UDBqV0F4MllSbkYyblFqbmlxbVlTTndia2ZlcXdjeHZPcHhtc2tCcldBMUR4ZjZtOUhYZ2lUMzBjMFJDNFhjLUh5UmFmNFNqcl9lVmVJczh1ajF2aGd3ZFotekw5dm5wX0VtLWtwakcyd0tsZmQ; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 30-Apr-2024 22:27:56 GMT; secure; SameSite=None; Secure", + "session_tracker=ggemlckrokajrdqool.0.1651444076060.Z0FBQUFBQmlid2xzNnJKdVBjTmhvSGZHU1daYnJKYmpiZ01nTE5hWm9KUHM0X3daWGNPb1JVcWstRzhjdjFzb1NPdFFmN1JnbmFnV3VfTGloMThoWE1xbDhpczJKU0hDd0hzdFozbnllU210VmxQMUEtOTkybS16aTNGZFR1UXZHNkd5SUp1WE9CaXI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 00:27:56 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 30-Apr-2025 22:27:56 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "124" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T22:27:56", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json&label=HELPFUL_USER¬e=test+note&reddit_id=t3_uflrmv&subreddit=&user=Lil_SpazTest" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "103" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "csv=2; edgebucket=99FHjDW5wEUtJkDz81; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlid2xzQnZGSUtYQ0VTd2dVcWZUM080UDBqV0F4MllSbkYyblFqbmlxbVlTTndia2ZlcXdjeHZPcHhtc2tCcldBMUR4ZjZtOUhYZ2lUMzBjMFJDNFhjLUh5UmFmNFNqcl9lVmVJczh1ajF2aGd3ZFotekw5dm5wX0VtLWtwakcyd0tsZmQ; redesign_optout=true; session_tracker=ggemlckrokajrdqool.0.1651444076060.Z0FBQUFBQmlid2xzNnJKdVBjTmhvSGZHU1daYnJKYmpiZ01nTE5hWm9KUHM0X3daWGNPb1JVcWstRzhjdjFzb1NPdFFmN1JnbmFnV3VfTGloMThoWE1xbDhpczJKU0hDd0hzdFozbnllU210VmxQMUEtOTkybS16aTNGZFR1UXZHNkd5SUp1WE9CaXI" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_46c71397-75cf-4e65-bc1a-47dc783736d8\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444076, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "461" + ], + "Date": [ + "Sun, 01 May 2022 22:27:56 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=ggemlckrokajrdqool.0.1651444076232.Z0FBQUFBQmlid2xzQjltUVdXSHo3N3hnclBWdjFZeEZoVXdLbWt4VUttWUFsVExoNkIyZjhsOGJUVVR4RmNXMWI2UnB2b2ZQRUpOYVVIMkQ2M3V0TzZBSVV2bWFFa21BTUtrUlZVbkpTV1BaYzJIc014dlJSMnVMMFhrMU13SF9pQWNvRXFweDE1M0g; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 00:27:56 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "598.0" + ], + "x-ratelimit-reset": [ + "124" + ], + "x-ratelimit-used": [ + "2" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestModNotes.test_create_note__thing_fullname.json b/tests/integration/cassettes/TestModNotes.test_create_note__thing_fullname.json new file mode 100644 index 000000000..e1c388006 --- /dev/null +++ b/tests/integration/cassettes/TestModNotes.test_create_note__thing_fullname.json @@ -0,0 +1,418 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-05-01T22:29:25", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"refresh_token\": \"\", \"scope\": \"creddits modnote modcontributors modmail modconfig subscribe structuredstyles vote wikiedit mysubreddits submit modlog modposts modflair save modothers adsconversions read privatemessages report identity livemanage account modtraffic wikiread edit modwiki modself flair history\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Cache-Control": [ + "private, max-age=3600" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "454" + ], + "Date": [ + "Sun, 01 May 2022 22:29:25 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=bQrE4bPuqV8ibt2eSM; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "296" + ], + "x-ratelimit-reset": [ + "35" + ], + "x-ratelimit-used": [ + "4" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-05-01T22:29:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=bQrE4bPuqV8ibt2eSM" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/info/?id=t3_uflrmv&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": null, \"subreddit\": \"\", \"selftext\": \"\", \"author_fullname\": \"t2_75u2lqkb\", \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test post\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"hide_score\": false, \"name\": \"t3_uflrmv\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"subreddit_type\": \"public\", \"ups\": 1, \"total_awards_received\": 0, \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"user_reports\": [], \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": null, \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": null, \"author_flair_richtext\": [], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"mod_note\": null, \"created\": 1651358011.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"domain\": \"self.\", \"allow_live_comments\": false, \"selftext_html\": null, \"likes\": null, \"suggested_sort\": \"top\", \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": null, \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"num_reports\": 0, \"distinguished\": null, \"subreddit_id\": \"t5_29ey0j\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"uflrmv\", \"is_robot_indexable\": true, \"report_reasons\": [], \"author\": \"Lil_SpazTest\", \"discussion_type\": null, \"num_comments\": 1, \"send_replies\": true, \"whitelist_status\": null, \"contest_mode\": false, \"mod_reports\": [], \"author_patreon_flair\": false, \"approved\": false, \"author_flair_text_color\": null, \"permalink\": \"/r//comments/uflrmv/test_post/\", \"parent_whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/uflrmv/test_post/\", \"subreddit_subscribers\": 2, \"created_utc\": 1651358011.0, \"num_crossposts\": 0, \"media\": null, \"is_video\": false}}], \"before\": null}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "2751" + ], + "Date": [ + "Sun, 01 May 2022 22:29:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlid25HUllhWnZVUkExX2M5OWNRN2J2VWpqbnI3YTZOQkJTbGtpSE5YNDNNeGVoUGVpM21iLU1xSEVPMEloVEtwazdVRDNuZXU4Yy1VQWJEb1lPOFBzcGc2Y0psVmx2c082WUFzWFRSSmhXakNZeExVUldhYXZqUjNqeDU5dGJLSXhreHY; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 30-Apr-2024 22:29:26 GMT; secure; SameSite=None; Secure", + "session_tracker=mpmfipiqhelqecmdjg.0.1651444166117.Z0FBQUFBQmlid25HT0pYbzFvYm9OYkZmVG1MSDd3bUdKWHZGR2UzZkhzWXU3VFlpUmpOUEFUdFgwNExPUm12MjBOem9VRks5bkdsS2Jka0xGVUY2bmJ3bTEzdzdldVg5bG5DUnk3S0JFTHBFV3laU05pU0lFb2ZVRWcydEV4M3czTi1WcWZIcGM3RTM; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 00:29:26 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 30-Apr-2025 22:29:26 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "597.0" + ], + "x-ratelimit-reset": [ + "34" + ], + "x-ratelimit-used": [ + "3" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/info/?id=t3_uflrmv&raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T22:29:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json&label=HELPFUL_USER¬e=test+note&reddit_id=t3_uflrmv&subreddit=&user=Lil_SpazTest" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "103" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "csv=2; edgebucket=bQrE4bPuqV8ibt2eSM; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlid25HUllhWnZVUkExX2M5OWNRN2J2VWpqbnI3YTZOQkJTbGtpSE5YNDNNeGVoUGVpM21iLU1xSEVPMEloVEtwazdVRDNuZXU4Yy1VQWJEb1lPOFBzcGc2Y0psVmx2c082WUFzWFRSSmhXakNZeExVUldhYXZqUjNqeDU5dGJLSXhreHY; redesign_optout=true; session_tracker=mpmfipiqhelqecmdjg.0.1651444166117.Z0FBQUFBQmlid25HT0pYbzFvYm9OYkZmVG1MSDd3bUdKWHZGR2UzZkhzWXU3VFlpUmpOUEFUdFgwNExPUm12MjBOem9VRks5bkdsS2Jka0xGVUY2bmJ3bTEzdzdldVg5bG5DUnk3S0JFTHBFV3laU05pU0lFb2ZVRWcydEV4M3czTi1WcWZIcGM3RTM" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_c5fe5eb8-e7a2-43d7-9e74-29aa8e7aabef\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444166, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "461" + ], + "Date": [ + "Sun, 01 May 2022 22:29:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=mpmfipiqhelqecmdjg.0.1651444166277.Z0FBQUFBQmlid25HaEJKSXJBQ1NPcE9tdG9MdlpLeVcxRk1lOHl6dWtGdGVRQ1JqM3NXNzJucElCSFI2d09Tc3lfMDF5VUhKOGJoZUlVUDBWVzRSOTZpX0NuNzdNYVFCSVVqcFVRZ2JQNTNPSE5KSElNVkM4TGUteFNsSDZvdHhFS0VpOWhVVUJLdHo; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 00:29:26 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "596.0" + ], + "x-ratelimit-reset": [ + "34" + ], + "x-ratelimit-used": [ + "4" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T22:29:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=bQrE4bPuqV8ibt2eSM; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlid25HUllhWnZVUkExX2M5OWNRN2J2VWpqbnI3YTZOQkJTbGtpSE5YNDNNeGVoUGVpM21iLU1xSEVPMEloVEtwazdVRDNuZXU4Yy1VQWJEb1lPOFBzcGc2Y0psVmx2c082WUFzWFRSSmhXakNZeExVUldhYXZqUjNqeDU5dGJLSXhreHY; redesign_optout=true; session_tracker=mpmfipiqhelqecmdjg.0.1651444166277.Z0FBQUFBQmlid25HaEJKSXJBQ1NPcE9tdG9MdlpLeVcxRk1lOHl6dWtGdGVRQ1JqM3NXNzJucElCSFI2d09Tc3lfMDF5VUhKOGJoZUlVUDBWVzRSOTZpX0NuNzdNYVFCSVVqcFVRZ2JQNTNPSE5KSElNVkM4TGUteFNsSDZvdHhFS0VpOWhVVUJLdHo" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": null, \"subreddit\": \"\", \"selftext\": \"\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test post\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_uflrmv\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"author_fullname\": \"t2_75u2lqkb\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": null, \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": null, \"previous_visits\": [1651360399.0, 1651442416.0], \"author_flair_richtext\": [], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1651358011.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": null, \"likes\": null, \"suggested_sort\": \"top\", \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": null, \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_29ey0j\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": 0, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"uflrmv\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Lil_SpazTest\", \"discussion_type\": null, \"num_comments\": 1, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": false, \"author_flair_text_color\": null, \"permalink\": \"/r//comments/uflrmv/test_post/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/uflrmv/test_post/\", \"subreddit_subscribers\": 2, \"created_utc\": 1651358011.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_29ey0j\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"\", \"removed\": false, \"author_flair_template_id\": null, \"likes\": true, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"i6yfrww\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"author\": \"\", \"rte_mode\": \"markdown\", \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_uflrmv\", \"score\": 1, \"author_fullname\": \"t2_o77bz\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"hi\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": null, \"name\": \"t1_i6yfrww\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Ehi\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": true, \"can_gild\": false, \"link_id\": \"t3_uflrmv\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r//comments/uflrmv/test_post/i6yfrww/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1651442460.0, \"author_flair_text\": null, \"treatment_tags\": [], \"spam\": false, \"created_utc\": 1651442460.0, \"subreddit_name_prefixed\": \"r/\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4804" + ], + "Date": [ + "Sun, 01 May 2022 22:29:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=mpmfipiqhelqecmdjg.0.1651444166417.Z0FBQUFBQmlid25HdHRhN0VVTFlLVjVUeldGSWxCLTQ4TUJ2X3lfdUZVbldKVjJoZ2hRaWd5Q2NmR1l4NHI1b3hTakwtV0QwLW93aXFSY3RRZUZnU0FONXpTZ1lFWWgyZEMyQ0JmUGRoQzA4QXl5R1d5UEg1b21ENW5aZUZsRjlDcnhBTS02SlhWNUY; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 00:29:26 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "595.0" + ], + "x-ratelimit-reset": [ + "34" + ], + "x-ratelimit-used": [ + "5" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestModNotes.test_delete_note.json b/tests/integration/cassettes/TestModNotes.test_delete_note.json new file mode 100644 index 000000000..7fd96f21a --- /dev/null +++ b/tests/integration/cassettes/TestModNotes.test_delete_note.json @@ -0,0 +1,412 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "290" + ], + "x-ratelimit-reset": [ + "495" + ], + "x-ratelimit-used": [ + "10" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json¬e=test+note&subreddit=&user=pyapitestuser3" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617705, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "435" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:21:45 GMT; secure", + "session_tracker=gooqloajgdmqkgicon.0.1648617705895.Z0FBQUFBQmlRLWpwNDUzNVJ4cXQwMy0xelFpa21JUVdZcHpEMHJaNmlwMzBNdG9HMFh6OWVZaDFnWFhoMkFhZURwTl9obmFSb2otd1RNOW9xYkJ0eFNQY2VUazZJQ0hBZVotZ25KWG8tbXgxQ3hhNTFtWjJLNy02ZDZ1M3JiMW1GZU83UGYzdHhfV0Q; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:45 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "587.0" + ], + "x-ratelimit-reset": [ + "495" + ], + "x-ratelimit-used": [ + "13" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; session_tracker=gooqloajgdmqkgicon.0.1648617705895.Z0FBQUFBQmlRLWpwNDUzNVJ4cXQwMy0xelFpa21JUVdZcHpEMHJaNmlwMzBNdG9HMFh6OWVZaDFnWFhoMkFhZURwTl9obmFSb2otd1RNOW9xYkJ0eFNQY2VUazZJQ0hBZVotZ25KWG8tbXgxQ3hhNTFtWjJLNy02ZDZ1M3JiMW1GZU83UGYzdHhfV0Q" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=gooqloajgdmqkgicon.0.1648617706031.Z0FBQUFBQmlRLWpxM3VXbGZXVWVvX1F6RVZHak4yV0Uwd0pOMFFhMGFnTW5wVHFIMlNoSkczLUZ4Wmdqb01HVkwxZ094ZGpsMjI2b2kwQ0wzWW5uNU90MTVPalZ5S2YzTEp2TXFrTnl1b0w3NDBjSVZBaGVEbkNkaEo0R3UzNGlSdU9iVGdjWldJdms; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:46 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "586.0" + ], + "x-ratelimit-reset": [ + "494" + ], + "x-ratelimit-used": [ + "14" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53&raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:21:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; session_tracker=gooqloajgdmqkgicon.0.1648617706031.Z0FBQUFBQmlRLWpxM3VXbGZXVWVvX1F6RVZHak4yV0Uwd0pOMFFhMGFnTW5wVHFIMlNoSkczLUZ4Wmdqb01HVkwxZ094ZGpsMjI2b2kwQ0wzWW5uNU90MTVPalZ5S2YzTEp2TXFrTnl1b0w3NDBjSVZBaGVEbkNkaEo0R3UzNGlSdU9iVGdjWldJdms" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=pyapitestuser3&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_61c08792-a55a-4d34-87f0-075bbca01f3e\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617670, \"cursor\": \"MTY0ODYxNzY3MDYyNA==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_527a60dc-f7f6-4acb-b4c0-653c426230cb\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617638, \"cursor\": \"MTY0ODYxNzYzODczOQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_486a277b-c35e-48a7-b473-f37e38621257\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441115, \"cursor\": \"MTY0ODQ0MTExNTM5Nw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_c085c0aa-1145-4e6b-9d74-07322bd77947\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441055, \"cursor\": \"MTY0ODQ0MTA1NTg0MA==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_fd62e7af-a06b-4701-8259-e554859b3c1c\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441021, \"cursor\": \"MTY0ODQ0MTAyMTU3Mw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_19a53dcf-4281-4887-84d2-eb0890cccec0\", \"user_note_data\": {\"note\": \"test note 3\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648440101, \"cursor\": \"MTY0ODQ0MDEwMTMyMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_346e1bf5-8c73-4b4b-b952-e56b1d583ada\", \"user_note_data\": {\"note\": \"test note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648440085, \"cursor\": \"MTY0ODQ0MDA4NTAwNQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5e6920c8-faae-4751-82b0-59a536f6130d\", \"user_note_data\": {\"note\": \"test note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439497, \"cursor\": \"MTY0ODQzOTQ5NzEwMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_1fe5cdfa-45cf-4c34-b613-35b6044071f6\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439326, \"cursor\": \"MTY0ODQzOTMyNjcxMw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_dc37a60d-4fc1-4a46-8d95-debbc014be46\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439157, \"cursor\": \"MTY0ODQzOTE1NzkyMw==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY0ODYxNzY3MDYyNA==\", \"end_cursor\": \"MTY0ODQzOTE1NzkyMw==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4727" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; Max-Age=63072000; Path=/; Domain=.reddit.com; SameSite=None; Secure", + "session_tracker=gooqloajgdmqkgicon.0.1648617706198.Z0FBQUFBQmlRLWpxaHRfeUZYWDlrSmZ3Y0N6RlRoeGdMZ1VJcmtQUEpieVJ6V1lIVmJPc195dE5SUy1Ma0RaVmdJTHlqakJPanJWSUoyZXllRzRlXy00MUppS09NSG1IT0owRXJCSTFGTlhSZkgteTJORHEyRUhfQU5yb0ZkQXM4dVNHMFFVak80ZXc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:46 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "494" + ], + "x-ratelimit-used": [ + "15" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=pyapitestuser3&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestModNotes.test_delete_note__all_notes.json b/tests/integration/cassettes/TestModNotes.test_delete_note__all_notes.json new file mode 100644 index 000000000..a2e21115c --- /dev/null +++ b/tests/integration/cassettes/TestModNotes.test_delete_note__all_notes.json @@ -0,0 +1,2958 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-30T21:52:49", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=crIk8EoFGNMTs4NRrg; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYS13TFNTNnkwX1pQSTBPaDFXcHlSQXRlQlRJOHZpZlp1U01GNDVJV3lSb3VLdlZXUS1xd3hTajFoRC1kcHE5UldrRFNDUWRNLWxyMGwzMjBqSFdieEVua1BWMzk1SXlWNXJiclBGelhscGl4TWhVNzd0UTNxUktrYk95RHpLTFhCR2c; session_tracker=bnhcrjgnkpimemgodn.0.1651355568837.Z0FBQUFBQmliYS13c2lwalR0eXh2Tzd6eVp6ZUpZNmxaclhUR29UdXp0RTVFV3MxYk5YdjdaMkJpbm05Zm1uMEx4aFRsNzJhb2M1U28yeTEwLXA2TjlzYThwZlBZRmhCWmQ2RjVlM2pQS0swYXh0VndheGF1bFpKOTZMbXdOOEREQTV0MUQxY1ZlLVc" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_ac852c6f-df22-4d93-a8fb-a091d4cc5252&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:52:49 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=bnhcrjgnkpimemgodn.0.1651355568962.Z0FBQUFBQmliYS14cmFWSG1JeTdEVUdFcTJ5RzRhM2FPUWpiMHN1cGN5UkJUVXZjNHBtZEM0cWs1ci1fOGlVTEVoRGpGLWcwTE1mS1I3cXlvdEVGRVN4aXFTeTljckl2X05HbG5ib0JyemFYREpxUXRVQ3oxQWRsZlRsNzNUdkJ4MVgwVHFXYTdjRzQ; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:52:49 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "596.0" + ], + "x-ratelimit-reset": [ + "432" + ], + "x-ratelimit-used": [ + "4" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_ac852c6f-df22-4d93-a8fb-a091d4cc5252&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:52:49", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=crIk8EoFGNMTs4NRrg; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYS13TFNTNnkwX1pQSTBPaDFXcHlSQXRlQlRJOHZpZlp1U01GNDVJV3lSb3VLdlZXUS1xd3hTajFoRC1kcHE5UldrRFNDUWRNLWxyMGwzMjBqSFdieEVua1BWMzk1SXlWNXJiclBGelhscGl4TWhVNzd0UTNxUktrYk95RHpLTFhCR2c; session_tracker=bnhcrjgnkpimemgodn.0.1651355568962.Z0FBQUFBQmliYS14cmFWSG1JeTdEVUdFcTJ5RzRhM2FPUWpiMHN1cGN5UkJUVXZjNHBtZEM0cWs1ci1fOGlVTEVoRGpGLWcwTE1mS1I3cXlvdEVGRVN4aXFTeTljckl2X05HbG5ib0JyemFYREpxUXRVQ3oxQWRsZlRsNzNUdkJ4MVgwVHFXYTdjRzQ" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_78a0d12a-0e41-4856-8bfb-237f8cacff25&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:52:49 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=bnhcrjgnkpimemgodn.0.1651355569273.Z0FBQUFBQmliYS14Zlkya3lTLVo1ZzllSW50ZEtBZ0xTaThzeXRrU3VYRzZfYVZWM3JuZ19uQ2RETFE2SGM4UWxsNkhrNUY5djBXYTJGV2UxSXplRjJETURfUHVMeWtiajUtQUdaOFhXckxVNlpxQWtBa2RYQk15bDJaXzl0QTFQM2NUaWdTVHNPdmM; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:52:49 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "595.0" + ], + "x-ratelimit-reset": [ + "431" + ], + "x-ratelimit-used": [ + "5" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_78a0d12a-0e41-4856-8bfb-237f8cacff25&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:53:56", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=CLwHTIfHWZ5ceN9SjE; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYV9lbVpRRGRaR0I0VHd3UDRqRFB3YnFIbU5Wd1R3WWpOMnhiLUd6MVJmZkxBbkJoU2VSTkJjSEt1RWNPWjVFUGNnWnJPb2VkNmxyRE1STkxYT09zam9BTFBLYzB4ODZGeWoxSjFCekFmQm5YYVVZQ1VsVnM3dm9MQkw4SmJzNDl5eTM; session_tracker=fkgbnrkceqpbqadqid.0.1651355636083.Z0FBQUFBQmliYV8wSWJlVEF4ckZlYzRUQTlSSnFNMmFMbHQxUVFfRzdrc1ZVajlHVjhaNzdWQnFhSHVQZm1BYl90bFlVX1RERzNnem5tMU5wcWdtbjRMdlQ4VVpBMmV3TXNPOVBQVy11NHN3QzVqYkFJX0R0NS05aUlEeHRVcU5KcmVpeDhFVVFjYUo" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_d39a8c78-4997-4f17-9386-d0d41a5b7a90&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"message\": \"Internal Server Error\", \"error\": 500}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "50" + ], + "Date": [ + "Sat, 30 Apr 2022 21:53:56 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=fkgbnrkceqpbqadqid.0.1651355636382.Z0FBQUFBQmliYV8wN0tyQVh0NVRqM21mdkdadHdWc3dCZU95RGFVSlB2Q2k4UWFjTHVsLWFFTDRmT3hVTU5CbGhNQlFueUlHcklGYklEWExTc3BCdnh1UXBsZmtVTGx1XzhlVGl2THhoSm1tMzdXdXNHV2VLOWF2bHFwTDV5OEpRa25mUHhuSmNRcHQ; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:53:56 GMT; secure", + "session_tracker=fkgbnrkceqpbqadqid.0.1651355636415.Z0FBQUFBQmliYV8wTGJWalNSSlZaWFIwamwtV3JFTzhvazdrbGp2ajhfUG9ueTFnT0k2dFU3cUJmV1I2dWExMDB4cDhlaXkzYjMzSjMzcUxPS1M0SDhnX3RQLVZfV3VHMF8tR25keU84d3RsaHd1a1ZxNmMxamZiWHR2elE0MDFWLUI2aFB4TzFOWW0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:53:56 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "588.0" + ], + "x-ratelimit-reset": [ + "364" + ], + "x-ratelimit-used": [ + "12" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 500, + "message": "Internal Server Error" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_d39a8c78-4997-4f17-9386-d0d41a5b7a90&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:54:07", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=cAbsdAV7A6sSlewxJI; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYV9fSHczSG1WZ1FqRFpLbDVPNzF3MTEzQ3RZVUhFN0dsc25pSHRVYkVkREpZdTktVDJJWTRoMUVVRDlnYjBobUQ2NFY0RU9kOFVjTkdtdm54WFI2SW44djdOd1NRODIyNmdJZDVMVnN6dG96ekIzcWhKVG9QTFB5ZEZ1cHN0enZZaEc; session_tracker=frfojbapobkcgldrmg.0.1651355647482.Z0FBQUFBQmliYV9fYy1ZcjhyZ1dVb3hBLW1fem5lMGZVNEpobk1vRTB4NFFxaFFHMVNCVjN2VHoxMlVaNkFOOTJZOE9GM0lZMjVzUThwazVCOHpUeWp6cUhadXNFc001b3VhNGtkbVNPX196X3U0YjAzaFRmeXNEdERPOV9vRDFuVktGcTFEdlVYTVQ" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_d3218ff0-4a7c-4b11-96a7-065558a0e3a2&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:54:07 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=frfojbapobkcgldrmg.0.1651355647631.Z0FBQUFBQmliYV9fZExBTjRrdnNqQWUyNldHd25yczhtOGhNZTRlcElsRDZ4ZmJXWDRPUW9FVjlFTEVKNlAyNGhCWHU4aWZvbVNNQmZyY0xhbGUtT2FwRU5lZE5uTFdIRktySExfc1B0UURHakxRQlptQzJ6a3d1V0R3dUtFekZNelJUSXNuRFlGVXc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:54:07 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "353" + ], + "x-ratelimit-used": [ + "15" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_d3218ff0-4a7c-4b11-96a7-065558a0e3a2&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:54:07", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=cAbsdAV7A6sSlewxJI; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYV9fSHczSG1WZ1FqRFpLbDVPNzF3MTEzQ3RZVUhFN0dsc25pSHRVYkVkREpZdTktVDJJWTRoMUVVRDlnYjBobUQ2NFY0RU9kOFVjTkdtdm54WFI2SW44djdOd1NRODIyNmdJZDVMVnN6dG96ekIzcWhKVG9QTFB5ZEZ1cHN0enZZaEc; session_tracker=frfojbapobkcgldrmg.0.1651355647631.Z0FBQUFBQmliYV9fZExBTjRrdnNqQWUyNldHd25yczhtOGhNZTRlcElsRDZ4ZmJXWDRPUW9FVjlFTEVKNlAyNGhCWHU4aWZvbVNNQmZyY0xhbGUtT2FwRU5lZE5uTFdIRktySExfc1B0UURHakxRQlptQzJ6a3d1V0R3dUtFekZNelJUSXNuRFlGVXc" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=pyapitestuser3&subreddit=&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"fields\": [\"note_id\"], \"explanation\": \"The parameter \\\"note_id\\\" is required.\", \"message\": \"Bad Request\", \"reason\": \"PARAMETER_REQUIRED\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "138" + ], + "Date": [ + "Sat, 30 Apr 2022 21:54:08 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=frfojbapobkcgldrmg.0.1651355647960.Z0FBQUFBQmliYV9fUEhCX29UX0VlWG1DOThyMVgzN1dUNUtnaEtHazducTNTMFlrVjZ2UFFNX0d2cTh5RFBrbjFxMWx3dlFuMnR2dGdhQzFWQlRFSE9vZGR4bmhQZTAzQ0x6QzNMR0NhOFYtZzV2X2Q3bklmeGRwS2lYeUNyV2hXTjliaURucTlnQ3Y; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:54:07 GMT; secure", + "session_tracker=frfojbapobkcgldrmg.0.1651355647976.Z0FBQUFBQmliYV9fck53dEtzLUpYSlJnTnFBem5YZWFjOUxCSG9JeE4yRjN5LVZtUGR0VEVnQ1VzQTY0M3Jsb1dQSnFTU2txQWh6VnBjOE9PYW1RcUpwalJRd2RMb09CdFB5RVdVN2VEVnBMekhmNGRJQnRRY0xFbVE3MDdKa2FEaG1hWU1LLW1XSE8; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:54:07 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "584.0" + ], + "x-ratelimit-reset": [ + "353" + ], + "x-ratelimit-used": [ + "16" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=pyapitestuser3&subreddit=&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:56:16", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=9M5sGtewVhGjExNfzP; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkNBX0NPVHNaWl83Vk9id3dlSkdyUVViOEJUdmtPMjFLUG84V1pwVXMyWGV6X3JqcnpEb296MUJzSTAyWkE3ZzQ2M1ZmM042Vng1dDFiYkpLTmh5emYyZXlobW4xUU82SHhIdTdLZnBkNDZCWkZDNXgxT3pEa0NsT1lVdWVkZGRFN2Q; session_tracker=gngrbccmccanclgacn.0.1651355776539.Z0FBQUFBQmliYkNBeERCTTZUUElwWWtMYi1nVEhtaEs3THRpbFloeXpIR2JCSlFTMEpFazdzQzhucG53eDNYVWtXd0RxemdEalJsRThnWkNyVUxqYzUyR203bXFyTDRTb3pqWmY4cV9zZlFJXy1BRjE3dENRMWpwTGZNdk8teWFJLTdmMzBpRnZKMVQ" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_b391dcb3-a16c-4e07-8a1f-13a3b60ec53e&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:56:16 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=gngrbccmccanclgacn.0.1651355776908.Z0FBQUFBQmliYkNBTDA2WXlJN3p5MG5PS1JQckVSTDJlWkhab0xBeGdZVGNnenpBOVF5aWQtR1V4bWFGV2ZmakVWNExlblRGa29rTkNlUDFQZDNpY0E5RG94dTd1MHZfeFRPVDlnSS1JYUdxdnJUNV9LUVk2QWIwYUw1cEJwbmxRWHBSd2Mxb0dfeXE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:56:16 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "580.0" + ], + "x-ratelimit-reset": [ + "224" + ], + "x-ratelimit-used": [ + "20" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_b391dcb3-a16c-4e07-8a1f-13a3b60ec53e&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:56:17", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=9M5sGtewVhGjExNfzP; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkNBX0NPVHNaWl83Vk9id3dlSkdyUVViOEJUdmtPMjFLUG84V1pwVXMyWGV6X3JqcnpEb296MUJzSTAyWkE3ZzQ2M1ZmM042Vng1dDFiYkpLTmh5emYyZXlobW4xUU82SHhIdTdLZnBkNDZCWkZDNXgxT3pEa0NsT1lVdWVkZGRFN2Q; session_tracker=gngrbccmccanclgacn.0.1651355776908.Z0FBQUFBQmliYkNBTDA2WXlJN3p5MG5PS1JQckVSTDJlWkhab0xBeGdZVGNnenpBOVF5aWQtR1V4bWFGV2ZmakVWNExlblRGa29rTkNlUDFQZDNpY0E5RG94dTd1MHZfeFRPVDlnSS1JYUdxdnJUNV9LUVk2QWIwYUw1cEJwbmxRWHBSd2Mxb0dfeXE" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_574ab5b5-2ad3-468c-94a5-8a20bec77915&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:56:17 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=gngrbccmccanclgacn.0.1651355777045.Z0FBQUFBQmliYkNCN3Y4MnZ6a1hTVlFVU0xWWDIxLVJaczZBN0YxdXNReHBOTmhfZWlaRW5sSGFMc2YyUE1aY1NYdXFQOFI5OEdNcUhkd3JGN2JQd0VPSUpDZHVjR093VmpXeVl1N05zc1NPTER3eXBXVzN1WVo4YzBhODU5cjJMSHFSa0E1S0FNVkE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:56:17 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "579.0" + ], + "x-ratelimit-reset": [ + "223" + ], + "x-ratelimit-used": [ + "21" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_574ab5b5-2ad3-468c-94a5-8a20bec77915&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:57:05", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=c4vGHx4l0u70sLjShg; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkN4Q2ctMTdWZEl2Q19zZzlWYUt6M0pCUVFHSXY3bk1vcENEN3IyVldlRExSUDZ2TGRUMERPeW1IcXRBTmMzekZWQ3czODd1d2pMa3NrWkRrY0EyVnBJdkVVamVNMlBQTU05UldEQm0xNUF0M3JWN183TUx1dmU4N1R4bTBDZUhzUWQ; session_tracker=gdhcmibalophmbopia.0.1651355825732.Z0FBQUFBQmliYkN4dkhfOEtPcTJqNjE0Z0hTSXNFMDFxMDhpVHB2a3FlNmh1M1RIenlZNzJfcFA5SHlLOXlQTnhlUlRmRWRvSExQNlN5YTZDOE9FYl9ISGc3TjNSLW9RVmFDeV9fU2xfbWpGaTBRUktOcHZGWjF3cDhBUG1wbHdoamtGbjRNLTFoX0E" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_a7a309e6-a768-4c96-9769-5d247a31cbaa&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:57:05 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=gdhcmibalophmbopia.0.1651355825897.Z0FBQUFBQmliYkN4VUdqcWFCVUowWUQtRG9HOHdpc3FqbkNkUXNCcmJHS1NLUmMwWTBJMjVhRldHX3d1cHdvNjY4TFpXbUtkT1BNZ1U1S29FUGF1cDV4Z3NkV05IQWg3d1dTUVlDX0Roa2xaTEJCRHAtTF9XMTJpRHVBXzNCSEVCUVR4cnUyOGoybnM; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:57:05 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "576.0" + ], + "x-ratelimit-reset": [ + "175" + ], + "x-ratelimit-used": [ + "24" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_a7a309e6-a768-4c96-9769-5d247a31cbaa&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T21:59:58", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=ekPKFwVAN7VHpZIWKU; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkZkYWRtYi1vaG9SRkpXSzZyWHhEaGtRSnNWVWNMNlJvaWZfVmQwWGxOX3BYaGlBeUpfM2JYT3pBMXNKQkVxTmRDTWtYc0RST0ItbnZycU0wMUp6NXo4MXYwaVhOTlBydGtuNUFqRTlZSm4yTkswVndlSkZKUjBFYV9EelZGTktEdTA; session_tracker=obfgdbdommgdcgahnh.0.1651355997765.Z0FBQUFBQmliYkZkaEk5bkkyX3pFcThvZ3BmSXhUNzM5djRiMjVoTk9qcGNRZkNKVWZFaGtsSGJfcElUWEFzNDF5VDZraGx6VnZQTjlReDJfNU1RMDh0andRMm5tNHo1bmRuUVlUOW5HbHpKZVpKWVVDUW5lLTQ1ZUVjb09kZ0ZWSmlrdWpjT0toZWc" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_43900289-d495-4fe5-b772-73b2d42166f8&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 21:59:58 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=obfgdbdommgdcgahnh.0.1651355998159.Z0FBQUFBQmliYkZlajk5Zzc0bzg1NmpCTWdFbVRZZlJmMTdEM3Mwd0pUVUd4dmxlb0ZoSDBySzJZT0RpdHVvWUlnSXRHZ2NmUzk4MFV6U29BLXpmcHVPWnprdVQ4ZHBfazdfX1VvRTZrQ0ZBWG53RU9tM3pQR0J0NGF2a2Y3NktfNW1XSExRbW1aTUo; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 30-Apr-2022 23:59:58 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "573.0" + ], + "x-ratelimit-reset": [ + "2" + ], + "x-ratelimit-used": [ + "27" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_43900289-d495-4fe5-b772-73b2d42166f8&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=zRyXrvYRRnJuNKp8Rb; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkdPSkRmdmRjeE1pU1ZLYmZMakZxV1VNQndEZFpOYXBPanJ2M2RsVVpzRC1PSXJGbE1sUldpQnBDbm1LQnJ6UENteERmdmh3UGhqbVNFcmxVbmhXbnFjUFVXV2UzQ1UyMFhwMXhudW54bnFsa0dXNjdaS25ualNXRkxmb05qeWFHVXE; session_tracker=lkhdhlrcdfhoqmdhic.0.1651356046667.Z0FBQUFBQmliYkdPTkxRMHBxeEIxVHdLVGhIY1RGS2U5ZlROUEJZQ20ya1lxcWNJV0R0ZXFWZmd1R2NyakpwZ0xCdTdaaDF2dGZ6c1p0Z3NDcjk1cmVxWncxaTE5VWhweTRaUno2NFZKVzEtSkNraWlOZVlCNGZWZUNITzg2M0d6Zm5XdVR0MWxVY2U" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_c2d6a5e7-debd-4994-b24f-f381c6cc8b9f&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 22:00:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=lkhdhlrcdfhoqmdhic.0.1651356046839.Z0FBQUFBQmliYkdPWnZKU3BrN09Da1M1cUthdEsyczlxSHBtbFBSYVNLTlBLRjhvTGM5OHJyNHZGem5OaloxRUd3OVhKVXNyTGp4dTkwaUY0S3ByRXROV0wwVzlmaDRyNERhal8yblVPY0xEWW96c21vWnlOQkhYWHhZd01mWndINXgtX1ZmVFNNdi0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:00:46 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "597.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_c2d6a5e7-debd-4994-b24f-f381c6cc8b9f&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=zRyXrvYRRnJuNKp8Rb; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkdPSkRmdmRjeE1pU1ZLYmZMakZxV1VNQndEZFpOYXBPanJ2M2RsVVpzRC1PSXJGbE1sUldpQnBDbm1LQnJ6UENteERmdmh3UGhqbVNFcmxVbmhXbnFjUFVXV2UzQ1UyMFhwMXhudW54bnFsa0dXNjdaS25ualNXRkxmb05qeWFHVXE; session_tracker=lkhdhlrcdfhoqmdhic.0.1651356046839.Z0FBQUFBQmliYkdPWnZKU3BrN09Da1M1cUthdEsyczlxSHBtbFBSYVNLTlBLRjhvTGM5OHJyNHZGem5OaloxRUd3OVhKVXNyTGp4dTkwaUY0S3ByRXROV0wwVzlmaDRyNERhal8yblVPY0xEWW96c21vWnlOQkhYWHhZd01mWndINXgtX1ZmVFNNdi0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"fields\": [\"accounts\"], \"explanation\": \"The parameter \\\"accounts\\\" is required.\", \"message\": \"Bad Request\", \"reason\": \"PARAMETER_REQUIRED\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "140" + ], + "Date": [ + "Sat, 30 Apr 2022 22:00:47 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=lkhdhlrcdfhoqmdhic.0.1651356046987.Z0FBQUFBQmliYkdPV2tYdTlIXzRZLVR6YkV4dDRMY2RUa2NOMEZZSkk5TjZUbWFxXzloekZfNENGanpMcGJZYnZxU0hPNHFTTXZRcnNGMk1NTE1oMGN0MV8wRUZtb1Rab3BJNE5KS3hjVFE2UlRKaEw5OXFaUDNNV3h2dWhxckFCaXhvd3JoRklUcTM; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:00:46 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "access-control-allow-origin": [ + "*" + ], + "access-control-expose-headers": [ + "X-Moose" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "596.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "4" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:02:22", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; session_tracker=bmhhhkhrgidjkhodgg.0.1651356142562.Z0FBQUFBQmliYkh1SngxSUl6T0xSeFpwYTZESVJ5SzJGVnJ3YmRycW45akUtcHN3MWdUdVg5Sy0wNnZ4TmE5T0l1T3JPR0I1V3l0NFliT3VuT0pKeUVOT1VaRl9OYkkzRk5JTWhWZGgxT3FaYnhHVHdORTBGWDlTU2NEZHhFX211NzdLcE82QzZXMUM" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_640c1769-bb33-4c81-88a8-c6534fe72d65&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 22:02:22 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356142863.Z0FBQUFBQmliYkh1aWJYdDhCbDFGZDVlaWVibFJtVHhkRnNqaHRqRnRPNGgwQUhpb0lLM2JIdWJ2c3gxZFo1amtCaGpxMUZidjZIUGduUHFXNllTVVM4RFRKT1NsOG8wR2tqZ1NDREZLWVlmd3RpLUJSVVZwdTRhWWpQdTlQYUFHcEVFbm1wVWtfcUM; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:02:22 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "593.0" + ], + "x-ratelimit-reset": [ + "458" + ], + "x-ratelimit-used": [ + "7" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_640c1769-bb33-4c81-88a8-c6534fe72d65&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:03:17", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; session_tracker=bmhhhkhrgidjkhodgg.0.1651356142863.Z0FBQUFBQmliYkh1aWJYdDhCbDFGZDVlaWVibFJtVHhkRnNqaHRqRnRPNGgwQUhpb0lLM2JIdWJ2c3gxZFo1amtCaGpxMUZidjZIUGduUHFXNllTVVM4RFRKT1NsOG8wR2tqZ1NDREZLWVlmd3RpLUJSVVZwdTRhWWpQdTlQYUFHcEVFbm1wVWtfcUM" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&accounts=pyapitestuser1&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"fields\": [\"accounts\"], \"explanation\": \"The parameter \\\"accounts\\\" is required.\", \"message\": \"Bad Request\", \"reason\": \"PARAMETER_REQUIRED\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "140" + ], + "Date": [ + "Sat, 30 Apr 2022 22:03:17 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356197758.Z0FBQUFBQmliYklsbmRKcHNEaEl1OU9idUJjR0pGYVlQdWM5RTlNV01ZUmQ1Vkg3OExpVGRIMURsMUVGNEhkRDRFZ1FPSGkzY0ZGSDVOV1lmMU55U3B5bk1VWGlrODZRdURTUGRkS0Nkc3Rxdm8teVpZVzM0dXNjLWdVMlZyWUNTSkZOc25ST2Y3b2g; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:03:17 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "access-control-allow-origin": [ + "*" + ], + "access-control-expose-headers": [ + "X-Moose" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "592.0" + ], + "x-ratelimit-reset": [ + "403" + ], + "x-ratelimit-used": [ + "8" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&accounts=pyapitestuser1&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:03:41", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; session_tracker=bmhhhkhrgidjkhodgg.0.1651356209188.Z0FBQUFBQmliYkl4NUZ0NWlzTEtkNmtjZzcyYVk3RnVUeC10Uks0U1hRTmVWZ1FnYWFKN2ZDTy1SRHVYN2hpc0lPQXVENzlwNVdQS1J3NTF0RDJoZ3h1S2xFbmxLNkpLdDJKZ0Z0M2NRLUphQ044NG9yR1RsaHNOR29qQnZqRVh3M2NyNi14SXMtVzU" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/r//about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t5\", \"data\": {\"user_flair_background_color\": null, \"submit_text_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Esubmit_text\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": false, \"wiki_enabled\": true, \"user_is_muted\": false, \"user_can_flair_in_sr\": true, \"display_name\": \"\", \"header_img\": \"https://b.thumbs.redditmedia.com/E4LN_I1u2bbhXabbPggf5iVku2j4J-5BFHvtB2stTJA.png\", \"title\": \"\", \"allow_galleries\": false, \"icon_size\": [256, 256], \"primary_color\": \"\", \"active_user_count\": 4, \"icon_img\": \"https://b.thumbs.redditmedia.com/9YfWue0XL2CLyD4j34JgSSdm3g-zUFcUcysD9zXV41s.jpg\", \"display_name_prefixed\": \"r/\", \"accounts_active\": 4, \"public_traffic\": false, \"subscribers\": 2, \"user_flair_richtext\": [], \"videostream_links_count\": 0, \"name\": \"t5_29ey0j\", \"quarantine\": false, \"hide_ads\": false, \"prediction_leaderboard_entry_type\": \"IN_FEED\", \"emojis_enabled\": false, \"advertiser_category\": \"\", \"public_description\": \"pub_desc\", \"comment_score_hide_mins\": 0, \"allow_predictions\": false, \"user_has_favorited\": false, \"user_flair_template_id\": null, \"community_icon\": \"\", \"banner_background_image\": \"https://styles.redditmedia.com/t5_29ey0j/styles/bannerBackgroundImage_vni73293e5a51.png?width=4000\\u0026s=5f74f9b38a3e8364a5b999e959ba0aa9726e2037\", \"original_content_tag_enabled\": false, \"community_reviewed\": false, \"submit_text\": \"submit_text\", \"description_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Enew sidebar content\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"spoilers_enabled\": false, \"allow_talks\": false, \"header_size\": [300, 300], \"user_flair_position\": \"right\", \"all_original_content\": false, \"collections_enabled\": true, \"is_enrolled_in_new_modmail\": true, \"key_color\": \"\", \"event_posts_enabled\": true, \"can_assign_user_flair\": false, \"created\": 1575168181.0, \"wls\": null, \"show_media_preview\": true, \"submission_type\": \"any\", \"user_is_subscriber\": true, \"disable_contributor_requests\": false, \"allow_videogifs\": true, \"should_archive_posts\": false, \"user_flair_type\": \"text\", \"allow_polls\": true, \"collapse_deleted_comments\": true, \"coins\": 0, \"emojis_custom_size\": null, \"public_description_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Epub_desc\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"allow_videos\": true, \"is_crosspostable_subreddit\": true, \"notification_level\": \"low\", \"can_assign_link_flair\": true, \"has_menu_widget\": false, \"accounts_active_is_fuzzed\": false, \"allow_prediction_contributors\": false, \"submit_text_label\": \"\", \"link_flair_position\": \"right\", \"user_sr_flair_enabled\": true, \"user_flair_enabled_in_sr\": true, \"allow_discovery\": true, \"accept_followers\": true, \"user_sr_theme_enabled\": false, \"link_flair_enabled\": true, \"subreddit_type\": \"public\", \"suggested_comment_sort\": \"top\", \"banner_img\": \"https://b.thumbs.redditmedia.com/UwKZ1FguKqLsZ-dVSM-D0-o2OJVyOWKw966EPKv5wKA.jpg\", \"user_flair_text\": null, \"banner_background_color\": \"\", \"show_media\": false, \"id\": \"29ey0j\", \"user_is_moderator\": true, \"over18\": false, \"header_title\": \"header text\", \"description\": \"new sidebar content\", \"submit_link_label\": \"\", \"user_flair_text_color\": null, \"restrict_commenting\": true, \"user_flair_css_class\": null, \"allow_images\": true, \"lang\": \"en\", \"whitelist_status\": null, \"url\": \"/r//\", \"created_utc\": 1575168181.0, \"banner_size\": [640, 192], \"mobile_banner_image\": \"\", \"user_is_contributor\": true, \"allow_predictions_tournament\": false}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "3595" + ], + "Date": [ + "Sat, 30 Apr 2022 22:03:41 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356221882.Z0FBQUFBQmliYkk5b0JiZXNPTDNhTUt4VHh4TDdxWmlHQk9wNW1qTFdlRi15TnZvcWNpOGJESUtSM0VwaHJJak1wWFRBXzBoOHJ2dHpxdHBXSC1ocWFWdDZBSVFuT0xUcUV5T1llamdld3E5VlljUU9rbVVBb08zVHVyRjdLY09RNk9OWHBTS1dlV3I; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:03:41 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Tue, 29-Apr-2025 22:03:41 GMT; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "590.0" + ], + "x-ratelimit-reset": [ + "379" + ], + "x-ratelimit-used": [ + "10" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/r//about/?raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:03", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356238695.Z0FBQUFBQmliYkpPR2JGMGhpb0VQT2ZYdllqNElncTRHc25CdUsyNDk4cmd5VzIzZkRIeUZsVzNnbVpvRzk5UHlCNWNURkxxVDhvZUxqeHpYMGw4OEJMWGRuUVdHNGVSaXJYM1JOS21NRnowTEtDYjN5VnVPQTRoTnJldEZRb01KN0hZbnhqUVpjdFI" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&accounts=pyapitestuser3&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"fields\": [\"accounts\"], \"explanation\": \"The parameter \\\"accounts\\\" is required.\", \"message\": \"Bad Request\", \"reason\": \"PARAMETER_REQUIRED\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "140" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:03 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356243514.Z0FBQUFBQmliYkpUdE9XSGFYQmVMNFl1eFVpbVhhb3B4Tlp1TXVrWHhlZlQ5UGV3aEZ3Y3IwVWhzQVJOejlfUXZvS2xaV1VVRHN1elBVOGZBajFUSHZsTVZ0aXJJOGxJRThZQVZpVXFVNUxjN3dELWxqUEpPYjA2NGg3a3RfcHBqVHMtZTlCZ0todUQ; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:03 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "access-control-allow-origin": [ + "*" + ], + "access-control-expose-headers": [ + "X-Moose" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "588.0" + ], + "x-ratelimit-reset": [ + "357" + ], + "x-ratelimit-used": [ + "12" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&accounts=pyapitestuser3&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:15", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356243514.Z0FBQUFBQmliYkpUdE9XSGFYQmVMNFl1eFVpbVhhb3B4Tlp1TXVrWHhlZlQ5UGV3aEZ3Y3IwVWhzQVJOejlfUXZvS2xaV1VVRHN1elBVOGZBajFUSHZsTVZ0aXJJOGxJRThZQVZpVXFVNUxjN3dELWxqUEpPYjA2NGg3a3RfcHBqVHMtZTlCZ0todUQ" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser3&accounts=pyapitestuser3&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:15 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356255726.Z0FBQUFBQmliYkpmTmdxWklGOWo5RzdrcGNYTWh3WVpqV25Za3JPeE1xV2RwNy1lZ3dKYUhQZUVUeVJhOWxUWDJyMmhsZ1BQb05NdmotQ1RYY0o4SDd4X0o1Szh6WjZIQlIxR3ZiV05yZG45OVAyblFZN2d2QUVRYlM2TmFDNDk0SlpZSGlwQXZzREw; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:15 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "587.0" + ], + "x-ratelimit-reset": [ + "345" + ], + "x-ratelimit-used": [ + "13" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser3&accounts=pyapitestuser3&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:27", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356255726.Z0FBQUFBQmliYkpmTmdxWklGOWo5RzdrcGNYTWh3WVpqV25Za3JPeE1xV2RwNy1lZ3dKYUhQZUVUeVJhOWxUWDJyMmhsZ1BQb05NdmotQ1RYY0o4SDd4X0o1Szh6WjZIQlIxR3ZiV05yZG45OVAyblFZN2d2QUVRYlM2TmFDNDk0SlpZSGlwQXZzREw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser3&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:27 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356267289.Z0FBQUFBQmliYkpyMWZkZGhCWU5GLUlLU3llYVRHM3NrdElCOTJXYi1pUlRiYzlpOTNTR1k5VndRZ1hLbUxqSkxvZjlWX1BqSTh6aWtCN291ZTFFQmdoTUJxNk04TkRUSXZGakg3NkpCeUY4b2ZlNXVJWTRKU2dkMm1sbTMwcGEtbDVoc2hOOFdwYl8; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:27 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "586.0" + ], + "x-ratelimit-reset": [ + "333" + ], + "x-ratelimit-used": [ + "14" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser3&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:31", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356267289.Z0FBQUFBQmliYkpyMWZkZGhCWU5GLUlLU3llYVRHM3NrdElCOTJXYi1pUlRiYzlpOTNTR1k5VndRZ1hLbUxqSkxvZjlWX1BqSTh6aWtCN291ZTFFQmdoTUJxNk04TkRUSXZGakg3NkpCeUY4b2ZlNXVJWTRKU2dkMm1sbTMwcGEtbDVoc2hOOFdwYl8" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser2&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:31 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356271327.Z0FBQUFBQmliYkp2Q003TkU2VHZFWVU5LVpSRU91cGpDUDVDUndJU2hfQm9kQk1NZnZXQjdmZHlhbjl2dURmMENnSnJNMHdpV3RFV1NzeHFYcldmQkRuNVVrMGJMRVJnMUNSMXdCVEg1bENqajVSR3RhOHRUQnpReFF1TmR5blp6N01lRFdKakxGMUo; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:31 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "329" + ], + "x-ratelimit-used": [ + "15" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser2&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:34", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356271327.Z0FBQUFBQmliYkp2Q003TkU2VHZFWVU5LVpSRU91cGpDUDVDUndJU2hfQm9kQk1NZnZXQjdmZHlhbjl2dURmMENnSnJNMHdpV3RFV1NzeHFYcldmQkRuNVVrMGJMRVJnMUNSMXdCVEg1bENqajVSR3RhOHRUQnpReFF1TmR5blp6N01lRFdKakxGMUo" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser1&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"message\": \"Bad Request\", \"error\": 400}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "40" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:34 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356274692.Z0FBQUFBQmliYkp5VjRyR0dPRlNpTlBYandmMmRRUWRsb3FrVGxKTE9LNDV1ZENzdGpMZzd4UHFuUS1NYl9iY0ZLS0p6OWRrXzlRSnFHUzcwVWdsdWZDNFlRVjJlcmR2MjdIWTNOWTNYelJybmE3bndQTHhzMEpHUDFrdUItUGloWVRGSmNhQnNKWG0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:34 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "access-control-allow-origin": [ + "*" + ], + "access-control-expose-headers": [ + "X-Moose" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "584.0" + ], + "x-ratelimit-reset": [ + "326" + ], + "x-ratelimit-used": [ + "16" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=pyapitestuser1&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:40", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356274692.Z0FBQUFBQmliYkp5VjRyR0dPRlNpTlBYandmMmRRUWRsb3FrVGxKTE9LNDV1ZENzdGpMZzd4UHFuUS1NYl9iY0ZLS0p6OWRrXzlRSnFHUzcwVWdsdWZDNFlRVjJlcmR2MjdIWTNOWTNYelJybmE3bndQTHhzMEpHUDFrdUItUGloWVRGSmNhQnNKWG0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=asdfasdfasdfas&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:40 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356280210.Z0FBQUFBQmliYko0aEMtOWtsTjJUT3d5X3JwLWVHVGNMM3hfZTF1STQtMHEteTR6Z05TeDFmbXF2b3EzeVczWDY1cy1uR2N3LVFsalViTk9kTWVHcTFHSnZyekk5emxISVZId3VkUHdqVkdJM2VIMkFMZXFRNllPWlhIUlpaNkVwUWs3ZWVxQVZHVFY; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:40 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "583.0" + ], + "x-ratelimit-reset": [ + "320" + ], + "x-ratelimit-used": [ + "17" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=asdfasdfasdfas&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:04:53", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356280210.Z0FBQUFBQmliYko0aEMtOWtsTjJUT3d5X3JwLWVHVGNMM3hfZTF1STQtMHEteTR6Z05TeDFmbXF2b3EzeVczWDY1cy1uR2N3LVFsalViTk9kTWVHcTFHSnZyekk5emxISVZId3VkUHdqVkdJM2VIMkFMZXFRNllPWlhIUlpaNkVwUWs3ZWVxQVZHVFY" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=Lil_SpazJoekpv5&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"message\": \"Bad Request\", \"error\": 400}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "40" + ], + "Date": [ + "Sat, 30 Apr 2022 22:04:53 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356293000.Z0FBQUFBQmliYktGYWI1ZDRQcmZlVURfNkpoZHA1Yy1zZjB1dzJyd2xvTTliWEdFUEJDYUhSNkVTOEV1WU1NajJjVkQzV3VFNkFGSzdBcENWTDFnVmRUTkhWejZvbU9pU2oydktUbUNJSXRkdldLQ28xZGt0VnJOcURUc0VEcVppUDlvcmxZeEtJeDk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:04:53 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "access-control-allow-origin": [ + "*" + ], + "access-control-expose-headers": [ + "X-Moose" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "582.0" + ], + "x-ratelimit-reset": [ + "307" + ], + "x-ratelimit-used": [ + "18" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 400, + "message": "Bad Request" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=Lil_SpazJoekpv5&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:05:03", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=78B49NqiDH6NQIwdns; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYkh1bXNXNjZMSzJzcWlUVFJZM2FKY2FnellNQXkzbnYyTWQ0bDhUc0Q2R1ZoSGdsUDdWZkJ0OXVCaFlBNjBVRlVpWGR3ZElCb0Jlb3dJMUNQeHNfNEdqYzhnejFZQXJnY3VOdEtGQ0NNX1YzYkhxcGVCdWVScXpXbmd3MWVTSjM5S2s; redesign_optout=true; session_tracker=bmhhhkhrgidjkhodgg.0.1651356293000.Z0FBQUFBQmliYktGYWI1ZDRQcmZlVURfNkpoZHA1Yy1zZjB1dzJyd2xvTTliWEdFUEJDYUhSNkVTOEV1WU1NajJjVkQzV3VFNkFGSzdBcENWTDFnVmRUTkhWejZvbU9pU2oydktUbUNJSXRkdldLQ28xZGt0VnJOcURUc0VEcVppUDlvcmxZeEtJeDk" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=spez&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Date": [ + "Sat, 30 Apr 2022 22:05:03 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bmhhhkhrgidjkhodgg.0.1651356303789.Z0FBQUFBQmliYktQZUtZZ0tjN3pNd29tU1VQNzVvS1FzbkFtWHlNWGo2U1ZJWFpnQnRTZXp1b2Flb2s3Y19JOHZYZm94U1RyUFdjNWxPLVN0eUY1QzFXU21yeE1MbmVGdkVnY3lZOU5mS2NZTldEMVBFdTJfX0IxdG9xT1RKOUtXT1o1SVVKMVFIenc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:05:03 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "581.0" + ], + "x-ratelimit-reset": [ + "297" + ], + "x-ratelimit-used": [ + "19" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=spez&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:12:47", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=TvBXF2y3Qgc5TwoF3x; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlJmTUtLMC1VdENuVDFKLVVLeDI5ajZjZWdCU3NHRm1ZeGlqeDZMa3hNaDA4VEN0ekdoUVRyQzlselgwUzlaRUthdFRyN1dkSXFMNmdWMWtla0daQjdDWXd6VUVhWkZWVXZiMTIySzhNNk5TZkJmTnpxQ1ZaaXVpcXpPM0g1UWdzOGg; session_tracker=epgenrfnfbgnejdfpk.0.1651356767424.Z0FBQUFBQmliYlJmcXRmNXFBOVhtMmtPOFZpcEF6R2ljUFMycHA4VDdXTG5pYlIwTGp4WllKb0JTeUJnQm9kaWF5UmN3bkhLZGFtZlNUbVAzMTVpYkgtQk9GcVhOa1hMc1VvWHFxZ0hGQmpFcExlRXowT2JPZTJnWTh0Yl9zcFpnUkhxLU9yVkZIeWQ" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_eae4e1f0-e040-413d-87a2-0246100599a8&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 22:12:47 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=epgenrfnfbgnejdfpk.0.1651356767567.Z0FBQUFBQmliYlJmRWV4RVdhWTlSV3JFS2p1U0d6OVlGdk9BZzVqZ01CMUJiZG9lZm04bEVnUEFkWlZwZDRtYXBnS2pUV19TaW5Vd184M2lQSnRSc0FGSXkzMVN2Q3BfY3NFejZDQWhoQWxGY2ctdC1mMDZtNThjSWJBa2t3NUdFMGEwSzMyM1VuWk0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:12:47 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "597.0" + ], + "x-ratelimit-reset": [ + "433" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_eae4e1f0-e040-413d-87a2-0246100599a8&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:13:00", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=tlCS7SUQt55vbIXuAx; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlJzdEZNYzd2SUN0eWJvakpBN0FDcmJFSVZqclRTOF9tZXZNSVQ4WHhnTjM4czNFRmxqcHNONVNkNHFlbWROSWFuN3ZjbjVpdVpKXzVMcUNIanphX2tta18wUURvTlZ0OHpyeU4wR1B6YWk5ZS1FeVBTUzB6TGg3aTVQNml1bWg2Yjc; session_tracker=dhcqdqligieprnoelo.0.1651356780811.Z0FBQUFBQmliYlJzRjY2VHZveVBtSmdIbzBqcV9OTjhRbHVLajk1blhkLVd1Smk2WFNuOElibGE1Y0l2SXVBcHlyUWhyMXJURGMxTkNkRk1uYmUyMTQxVzN4M2t5akVsR250Z0xKQmljd2VwOXNHcG0waW1PbDZRWUhiczY5bmdqSmJ3YVNYbjAwRV8" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_9d786d27-6dd3-4a3f-97ab-3cbcfe99a202&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 22:13:01 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=dhcqdqligieprnoelo.0.1651356780948.Z0FBQUFBQmliYlJzQmFib1R5UTdkNnJTdVBXSlZGR25KZVFZX0dobEJ2T2Fub19wb3Z5aUQzRjRpZ2F0NDZfY3Y1TEtPRGlCTlM3LVJjTlVGNkpudUF5bGM4NjVPNHlpY3BzSnRjdEUtMFZIejY5TkZST2pYTDFDQWVmVUdLNUFvUGJRRXViTkFURjc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:13:00 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "593.0" + ], + "x-ratelimit-reset": [ + "420" + ], + "x-ratelimit-used": [ + "7" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_9d786d27-6dd3-4a3f-97ab-3cbcfe99a202&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:14:54", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"refresh_token\": \"\", \"scope\": \"creddits modnote modcontributors modmail modconfig subscribe structuredstyles vote wikiedit mysubreddits submit modlog modposts modflair save modothers adsconversions read privatemessages report identity livemanage account modtraffic wikiread edit modwiki modself flair history\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Cache-Control": [ + "private, max-age=3600" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "454" + ], + "Date": [ + "Sat, 30 Apr 2022 22:14:54 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=TEC5q2sPkDxWSF6K30; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "297" + ], + "x-ratelimit-reset": [ + "306" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-30T22:14:54", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json¬e=test+note&subreddit=&user=pyapitestuser3" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "66" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "edgebucket=TEC5q2sPkDxWSF6K30" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Lil_SpazJoekp\", \"id\": \"ModNote_f0cec9bf-2290-4d6f-bc2f-1f35430f0620\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1651356894, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "436" + ], + "Date": [ + "Sat, 30 Apr 2022 22:14:54 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlRlZVFYWDBzRlNldGpLTU92dDJ5RWxKaVpWM29SQnBrRmpxQ0ZaRnl4TTlvQzhzOUV1XzBIcE40Wk9aY1V5SlpyUEpSVVBIZ3d1LUxnQWhILWN4bXU4cW1wMC1WNTdUekI4MW5TcWxqeXZ5SS1hdmJnaGU5RVRzUTRxTExvbF9yWjQ; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 29-Apr-2024 22:14:54 GMT; secure", + "session_tracker=fipommjnbjejodcqcb.0.1651356894758.Z0FBQUFBQmliYlRlbGM3X0VMUVBMR0R6WVdBN0VtbDY4OUlweTY5blVtbnlZYkp1VGFNNDNRTVNSaTczZGVIajhCRElnSGgyWTRRZ1pmNUVsczZ5WlF0XzVZeXc5SlVyTE9oZGZWUGtTRUVzekFLbjdXbEE0RVkxRm94SUt0WDJ2cDhXeG41M2tGSVA; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:14:54 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "591.0" + ], + "x-ratelimit-reset": [ + "306" + ], + "x-ratelimit-used": [ + "9" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:14:54", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=TEC5q2sPkDxWSF6K30; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlRlZVFYWDBzRlNldGpLTU92dDJ5RWxKaVpWM29SQnBrRmpxQ0ZaRnl4TTlvQzhzOUV1XzBIcE40Wk9aY1V5SlpyUEpSVVBIZ3d1LUxnQWhILWN4bXU4cW1wMC1WNTdUekI4MW5TcWxqeXZ5SS1hdmJnaGU5RVRzUTRxTExvbF9yWjQ; session_tracker=fipommjnbjejodcqcb.0.1651356894758.Z0FBQUFBQmliYlRlbGM3X0VMUVBMR0R6WVdBN0VtbDY4OUlweTY5blVtbnlZYkp1VGFNNDNRTVNSaTczZGVIajhCRElnSGgyWTRRZ1pmNUVsczZ5WlF0XzVZeXc5SlVyTE9oZGZWUGtTRUVzekFLbjdXbEE0RVkxRm94SUt0WDJ2cDhXeG41M2tGSVA" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=PyAPITestUser3&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Lil_SpazJoekp\", \"id\": \"ModNote_f0cec9bf-2290-4d6f-bc2f-1f35430f0620\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1651356894, \"cursor\": \"MTY1MTM1Njg5NDc3Nw==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY1MTM1Njg5NDc3Nw==\", \"end_cursor\": \"MTY1MTM1Njg5NDc3Nw==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "576" + ], + "Date": [ + "Sat, 30 Apr 2022 22:14:55 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlRlZVFYWDBzRlNldGpLTU92dDJ5RWxKaVpWM29SQnBrRmpxQ0ZaRnl4TTlvQzhzOUV1XzBIcE40Wk9aY1V5SlpyUEpSVVBIZ3d1LUxnQWhILWN4bXU4cW1wMC1WNTdUekI4MW5TcWxqeXZ5SS1hdmJnaGU5RVRzUTRxTExvbF9yWjQ; Max-Age=63072000; Path=/; Domain=.reddit.com; SameSite=None; Secure", + "session_tracker=fipommjnbjejodcqcb.0.1651356894947.Z0FBQUFBQmliYlRlQ0FUNGNPVVU1MS10aC1LdmFqNTc3OV85aG9aYTdKQkM1bURRQ1kwbUw2amx3NXRrVzA1MHN1clJjX2RtMmVsdS00dXZHQzczQTBDWV96OUZTQXVVbHBPem9pdmtvTlA0djdVODlSY3RrQ1d0OHh2RFNKTll1UUFhSVVwUTBMVFY; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:14:54 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "590.0" + ], + "x-ratelimit-reset": [ + "306" + ], + "x-ratelimit-used": [ + "10" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=PyAPITestUser3&limit=100&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:14:55", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "csv=2; edgebucket=TEC5q2sPkDxWSF6K30; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlRlZVFYWDBzRlNldGpLTU92dDJ5RWxKaVpWM29SQnBrRmpxQ0ZaRnl4TTlvQzhzOUV1XzBIcE40Wk9aY1V5SlpyUEpSVVBIZ3d1LUxnQWhILWN4bXU4cW1wMC1WNTdUekI4MW5TcWxqeXZ5SS1hdmJnaGU5RVRzUTRxTExvbF9yWjQ; session_tracker=fipommjnbjejodcqcb.0.1651356894947.Z0FBQUFBQmliYlRlQ0FUNGNPVVU1MS10aC1LdmFqNTc3OV85aG9aYTdKQkM1bURRQ1kwbUw2amx3NXRrVzA1MHN1clJjX2RtMmVsdS00dXZHQzczQTBDWV96OUZTQXVVbHBPem9pdmtvTlA0djdVODlSY3RrQ1d0OHh2RFNKTll1UUFhSVVwUTBMVFY" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_f0cec9bf-2290-4d6f-bc2f-1f35430f0620&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Date": [ + "Sat, 30 Apr 2022 22:14:55 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=fipommjnbjejodcqcb.0.1651356895096.Z0FBQUFBQmliYlRmLU41Ynk1NHY1SEtQNmFkaHF1Y2IzaVVaWEFzbXR2OC1KdmNLbXdHMWlyWElTaUZjbmxkRTFMMC1FbjVSNXliVERIMnI3VEF1SjhQcW9kXzg0c3JFYml0aTlmaGRIV0hnUTU0aFNhS2FuLS1qQXZsMHNVQkNEQWQxRDBBNEg1Szc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:14:55 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "589.0" + ], + "x-ratelimit-reset": [ + "305" + ], + "x-ratelimit-used": [ + "11" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=¬e_id=ModNote_f0cec9bf-2290-4d6f-bc2f-1f35430f0620&raw_json=1" + } + }, + { + "recorded_at": "2022-04-30T22:14:55", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=TEC5q2sPkDxWSF6K30; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmliYlRlZVFYWDBzRlNldGpLTU92dDJ5RWxKaVpWM29SQnBrRmpxQ0ZaRnl4TTlvQzhzOUV1XzBIcE40Wk9aY1V5SlpyUEpSVVBIZ3d1LUxnQWhILWN4bXU4cW1wMC1WNTdUekI4MW5TcWxqeXZ5SS1hdmJnaGU5RVRzUTRxTExvbF9yWjQ; session_tracker=fipommjnbjejodcqcb.0.1651356895096.Z0FBQUFBQmliYlRmLU41Ynk1NHY1SEtQNmFkaHF1Y2IzaVVaWEFzbXR2OC1KdmNLbXdHMWlyWElTaUZjbmxkRTFMMC1FbjVSNXliVERIMnI3VEF1SjhQcW9kXzg0c3JFYml0aTlmaGRIV0hnUTU0aFNhS2FuLS1qQXZsMHNVQkNEQWQxRDBBNEg1Szc" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=pyapitestuser3&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [], \"start_cursor\": null, \"end_cursor\": null, \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "83" + ], + "Date": [ + "Sat, 30 Apr 2022 22:14:55 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=fipommjnbjejodcqcb.0.1651356895252.Z0FBQUFBQmliYlRmTTVXQlBaV3EwTnphdkMtaVVkOXB1Nmw0V3FQa1F4Z2FNWHpmLUpTbm1VYl9OYlFVdFQtaFFHVmE1c295R2dodlJkT0RWV2UzYTFNQm5oaUZjZTVsUGxOUVBnYUdQVUFZR3hucHAycmdPbE1qSS1RWm9OSzQ2VGNYOFRTU0tjTm0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 01-May-2022 00:14:55 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "588.0" + ], + "x-ratelimit-reset": [ + "305" + ], + "x-ratelimit-used": [ + "12" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=pyapitestuser3&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestReddit.test_get_bulk_notes.json b/tests/integration/cassettes/TestReddit.test_get_bulk_notes.json new file mode 100644 index 000000000..c8d74d005 --- /dev/null +++ b/tests/integration/cassettes/TestReddit.test_get_bulk_notes.json @@ -0,0 +1,311 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=W4LvH3G38pYgRHKXfw; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=W4LvH3G38pYgRHKXfw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/jlbw48/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": \"\", \"approved_at_utc\": 1613597252, \"subreddit\": \"SubTestBot1\", \"selftext\": \"Test self post text\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test self post\", \"link_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 2\"}], \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": \"test 2\", \"downs\": 0, \"user_reports_dismissed\": [[\"test report\", 1, false, false]], \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_jlbw48\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.SubTestBot1\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"author_fullname\": \"t2_1199gq\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": \"test 2\", \"can_mod_post\": true, \"score\": 1, \"approved_by\": \"Watchful1\", \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": \"\", \"previous_visits\": [1648879964.0, 1648960045.0, 1648960963.0], \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1604116789.0, \"link_flair_type\": \"richtext\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003ETest self post text\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"likes\": null, \"suggested_sort\": null, \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"link_flair_template_id\": \"865ba524-692d-11e9-9811-0e2f1d7746a8\", \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_3fib0\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": -1, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"jlbw48\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Watchful1BotTest\", \"discussion_type\": null, \"num_comments\": 6, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": true, \"author_flair_text_color\": \"dark\", \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r/SubTestBot1/comments/jlbw48/test_self_post/\", \"subreddit_subscribers\": 13, \"created_utc\": 1604116789.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": \"Watchful1\", \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": true, \"author_flair_template_id\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"ban_note\": \"remove not spam\", \"saved\": false, \"id\": \"gao5889\", \"banned_at_utc\": 1604116815, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test comment\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gao5889\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"collapsed_reason\": null, \"gildings\": {}, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao5889/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604116799.0, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"author\": \"Watchful1BotTest\", \"created_utc\": 1604116799.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest comment\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"num_reports\": 0, \"ups\": 1}}, {\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": \"Watchful1\", \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": true, \"author_flair_template_id\": null, \"likes\": null, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"gao66wc\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gao66g9\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"test tree 2\", \"edited\": false, \"author_flair_css_class\": \"\", \"name\": \"t1_gao66wc\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest tree 2\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"top_awarded_type\": null, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"treatment_tags\": [], \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao66wc/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604117521.0, \"author_flair_text\": \":downvote:\", \"collapsed\": false, \"author\": \"Watchful1BotTest\", \"created_utc\": 1604117521.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 1, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"ban_note\": \"remove not spam\", \"saved\": false, \"id\": \"gao66g9\", \"banned_at_utc\": 1604117545, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test tree 1\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gao66g9\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"collapsed_reason\": null, \"gildings\": {}, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao66g9/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604117511.0, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"author\": \"Watchful1BotTest\", \"created_utc\": 1604117511.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest tree 1\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"num_reports\": 0, \"ups\": 1}}, {\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"likes\": true, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"gt032vq\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gt00mip\", \"score\": 1, \"author_fullname\": \"t2_pvnt22n\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"Watchful1 mentions kids in 0 posts and 4 comments.\\n \\n Sentiment of relevant posts and comments:\\n Negative: 0\\n Neutral: 0\\n Positive: 4\", \"edited\": false, \"top_awarded_type\": null, \"downs\": 0, \"author_flair_css_class\": null, \"name\": \"t1_gt032vq\", \"is_submitter\": false, \"collapsed\": false, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003EWatchful1 mentions kids in 0 posts and 4 comments.\\u003C/p\\u003E\\n\\n\\u003Cpre\\u003E\\u003Ccode\\u003E Sentiment of relevant posts and comments:\\n Negative: 0\\n Neutral: 0\\n Positive: 4\\n\\u003C/code\\u003E\\u003C/pre\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"removed\": false, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gt032vq/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1617257170.0, \"author_flair_text\": null, \"treatment_tags\": [], \"author\": \"KJ_Bot\", \"created_utc\": 1617257170.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 2, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"saved\": false, \"id\": \"gt00mip\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gius5s0\", \"score\": 1, \"author_fullname\": \"t2_b9kjg7gf\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"bottest2314 kids\", \"edited\": false, \"author_flair_css_class\": null, \"name\": \"t1_gt00mip\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Ebottest2314 kids\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"top_awarded_type\": null, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"treatment_tags\": [], \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gt00mip/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1617255172.0, \"author_flair_text\": null, \"collapsed\": false, \"author\": \"wapisagoodsong\", \"created_utc\": 1617255172.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 1, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"saved\": false, \"id\": \"gius5s0\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"author\": \"Watchful1\", \"rte_mode\": \"markdown\", \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_d0z23\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test\\n\\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/) \\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/) \\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/)\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gius5s0\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":jpow:\", \"u\": \"https://emoji.redditmedia.com/z6mcord6fyq81_t5_3fib0/jpow\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest\\u003C/p\\u003E\\n\\n\\u003Cp\\u003E\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003Cbr/\\u003E\\n\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003Cbr/\\u003E\\n\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": true, \"can_gild\": false, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gius5s0/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1610351778.0, \"author_flair_text\": \":jpow:\", \"treatment_tags\": [], \"spam\": false, \"created_utc\": 1610351778.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17414" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU24tSURyUmtEUWJZU0Zpb2M3S0RMbDJoa3hiaFgtc0VIbVR6Tm5JM0R2T2d1bXRNeTg5YkdwbXM4YzJzZTJOOWJwaHhyYjQxNlo5cGR2SWw2bUtib2swdG9ORk9VWGVpd1pRd1k0U0otMm5JYllkcjZmVDBCcXh2TFU0eUxxbDBtdEI; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 02-Apr-2024 05:00:46 GMT; secure; SameSite=None; Secure", + "session_tracker=eodebbifabkglfmbpj.0.1648962045893.Z0FBQUFBQmlTU24tZzBJNnF4ZWNaNkdJV3llV0UyRzZMQ3RYMGV1LVkxZXEyUDJ3SFpXY1FoV0hEeHBNVnU3R2JPR2tGUG84VjN2YmlrMVNxWDNRZDk2Z1lIYTFKX3pGYndIUGdCWlZpZUZQLTFuR29oVFRHOGxpNWJQMFFka1U5LUNnQkl5bS1fVk0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 07:00:46 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 02-Apr-2025 05:00:45 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/jlbw48/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=W4LvH3G38pYgRHKXfw; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU24tSURyUmtEUWJZU0Zpb2M3S0RMbDJoa3hiaFgtc0VIbVR6Tm5JM0R2T2d1bXRNeTg5YkdwbXM4YzJzZTJOOWJwaHhyYjQxNlo5cGR2SWw2bUtib2swdG9ORk9VWGVpd1pRd1k0U0otMm5JYllkcjZmVDBCcXh2TFU0eUxxbDBtdEI; redesign_optout=true; session_tracker=eodebbifabkglfmbpj.0.1648962045893.Z0FBQUFBQmlTU24tZzBJNnF4ZWNaNkdJV3llV0UyRzZMQ3RYMGV1LVkxZXEyUDJ3SFpXY1FoV0hEeHBNVnU3R2JPR2tGUG84VjN2YmlrMVNxWDNRZDk2Z1lIYTFKX3pGYndIUGdCWlZpZUZQLTFuR29oVFRHOGxpNWJQMFFka1U5LUNnQkl5bS1fVk0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=SubTestBot1%2CSubTestBot1%2CSubTestBot1%2CSubTestBot1&users=Watchful1%2Cwatchful12%2Cspez%2CWatchful1BotTest&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_f88e2a6c-3776-42c4-976b-7062ab1fba03\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648620243, \"type\": \"NOTE\"}, null, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "882" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=eodebbifabkglfmbpj.0.1648962046187.Z0FBQUFBQmlTU24tTlUzQ0NmcFlRZHNDaEtXcjY3bXgzRjcwTmYzZWp6S2xTRE51eXRhTnhKcC1Uel91dWZ0QkM3eEJoXzV6RlZORmgyRk9nRmNrOFB1MGNoelc0Q0N2a2ZVSkUwbENBa3prV1Jfa25Wb2F1TEt5ZDdmTEpWSWRWdG5sb1VJZGpNeFk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 07:00:46 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "598.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "2" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=SubTestBot1%2CSubTestBot1%2CSubTestBot1%2CSubTestBot1&users=Watchful1%2Cwatchful12%2Cspez%2CWatchful1BotTest&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestReddit.test_notes__call__.json b/tests/integration/cassettes/TestReddit.test_notes__call__.json new file mode 100644 index 000000000..c8d74d005 --- /dev/null +++ b/tests/integration/cassettes/TestReddit.test_notes__call__.json @@ -0,0 +1,311 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=W4LvH3G38pYgRHKXfw; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=W4LvH3G38pYgRHKXfw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/jlbw48/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": \"\", \"approved_at_utc\": 1613597252, \"subreddit\": \"SubTestBot1\", \"selftext\": \"Test self post text\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test self post\", \"link_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 2\"}], \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": \"test 2\", \"downs\": 0, \"user_reports_dismissed\": [[\"test report\", 1, false, false]], \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_jlbw48\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.SubTestBot1\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"author_fullname\": \"t2_1199gq\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": \"test 2\", \"can_mod_post\": true, \"score\": 1, \"approved_by\": \"Watchful1\", \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": \"\", \"previous_visits\": [1648879964.0, 1648960045.0, 1648960963.0], \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1604116789.0, \"link_flair_type\": \"richtext\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003ETest self post text\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"likes\": null, \"suggested_sort\": null, \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"link_flair_template_id\": \"865ba524-692d-11e9-9811-0e2f1d7746a8\", \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_3fib0\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": -1, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"jlbw48\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Watchful1BotTest\", \"discussion_type\": null, \"num_comments\": 6, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": true, \"author_flair_text_color\": \"dark\", \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r/SubTestBot1/comments/jlbw48/test_self_post/\", \"subreddit_subscribers\": 13, \"created_utc\": 1604116789.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": \"Watchful1\", \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": true, \"author_flair_template_id\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"ban_note\": \"remove not spam\", \"saved\": false, \"id\": \"gao5889\", \"banned_at_utc\": 1604116815, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test comment\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gao5889\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"collapsed_reason\": null, \"gildings\": {}, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao5889/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604116799.0, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"author\": \"Watchful1BotTest\", \"created_utc\": 1604116799.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest comment\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"num_reports\": 0, \"ups\": 1}}, {\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": \"Watchful1\", \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": true, \"author_flair_template_id\": null, \"likes\": null, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"gao66wc\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gao66g9\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"test tree 2\", \"edited\": false, \"author_flair_css_class\": \"\", \"name\": \"t1_gao66wc\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest tree 2\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"top_awarded_type\": null, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"treatment_tags\": [], \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao66wc/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604117521.0, \"author_flair_text\": \":downvote:\", \"collapsed\": false, \"author\": \"Watchful1BotTest\", \"created_utc\": 1604117521.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 1, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"ban_note\": \"remove not spam\", \"saved\": false, \"id\": \"gao66g9\", \"banned_at_utc\": 1604117545, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_1199gq\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test tree 1\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gao66g9\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":downvote:\", \"u\": \"https://emoji.redditmedia.com/r05m1xcm1guz_t5_3nqvj/downvote\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"collapsed_reason\": null, \"gildings\": {}, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gao66g9/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1604117511.0, \"author_flair_text\": \":downvote:\", \"treatment_tags\": [], \"author\": \"Watchful1BotTest\", \"created_utc\": 1604117511.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest tree 1\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"num_reports\": 0, \"ups\": 1}}, {\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": \"\", \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"likes\": true, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"removed\": false, \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_3fib0\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"SubTestBot1\", \"author_flair_template_id\": null, \"distinguished\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"gt032vq\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gt00mip\", \"score\": 1, \"author_fullname\": \"t2_pvnt22n\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"Watchful1 mentions kids in 0 posts and 4 comments.\\n \\n Sentiment of relevant posts and comments:\\n Negative: 0\\n Neutral: 0\\n Positive: 4\", \"edited\": false, \"top_awarded_type\": null, \"downs\": 0, \"author_flair_css_class\": null, \"name\": \"t1_gt032vq\", \"is_submitter\": false, \"collapsed\": false, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003EWatchful1 mentions kids in 0 posts and 4 comments.\\u003C/p\\u003E\\n\\n\\u003Cpre\\u003E\\u003Ccode\\u003E Sentiment of relevant posts and comments:\\n Negative: 0\\n Neutral: 0\\n Positive: 4\\n\\u003C/code\\u003E\\u003C/pre\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"removed\": false, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gt032vq/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1617257170.0, \"author_flair_text\": null, \"treatment_tags\": [], \"author\": \"KJ_Bot\", \"created_utc\": 1617257170.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 2, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"saved\": false, \"id\": \"gt00mip\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t1_gius5s0\", \"score\": 1, \"author_fullname\": \"t2_b9kjg7gf\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"body\": \"bottest2314 kids\", \"edited\": false, \"author_flair_css_class\": null, \"name\": \"t1_gt00mip\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Ebottest2314 kids\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"link_id\": \"t3_jlbw48\", \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"top_awarded_type\": null, \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"treatment_tags\": [], \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gt00mip/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1617255172.0, \"author_flair_text\": null, \"collapsed\": false, \"author\": \"wapisagoodsong\", \"created_utc\": 1617255172.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 1, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}, \"user_reports\": [], \"saved\": false, \"id\": \"gius5s0\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": false, \"author\": \"Watchful1\", \"rte_mode\": \"markdown\", \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_jlbw48\", \"score\": 1, \"author_fullname\": \"t2_d0z23\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test\\n\\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/) \\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/) \\n[If a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]](https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/)\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": \"\", \"name\": \"t1_gius5s0\", \"is_submitter\": false, \"downs\": 0, \"author_flair_richtext\": [{\"a\": \":jpow:\", \"u\": \"https://emoji.redditmedia.com/z6mcord6fyq81_t5_3fib0/jpow\", \"e\": \"emoji\"}], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest\\u003C/p\\u003E\\n\\n\\u003Cp\\u003E\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003Cbr/\\u003E\\n\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003Cbr/\\u003E\\n\\u003Ca href=\\\"https://www.reddit.com/r/TalesFromTheCryptid/comments/ko81f4/if_you_see_a_sickly_boy_in_a_blue_hoodie_please/\\\"\\u003EIf a creature comes down your chimney this Christmas, you may not live to see the morning. [Part 2][FINAL]\\u003C/a\\u003E\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": true, \"can_gild\": false, \"link_id\": \"t3_jlbw48\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": \"dark\", \"score_hidden\": false, \"permalink\": \"/r/SubTestBot1/comments/jlbw48/test_self_post/gius5s0/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1610351778.0, \"author_flair_text\": \":jpow:\", \"treatment_tags\": [], \"spam\": false, \"created_utc\": 1610351778.0, \"subreddit_name_prefixed\": \"r/SubTestBot1\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17414" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU24tSURyUmtEUWJZU0Zpb2M3S0RMbDJoa3hiaFgtc0VIbVR6Tm5JM0R2T2d1bXRNeTg5YkdwbXM4YzJzZTJOOWJwaHhyYjQxNlo5cGR2SWw2bUtib2swdG9ORk9VWGVpd1pRd1k0U0otMm5JYllkcjZmVDBCcXh2TFU0eUxxbDBtdEI; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 02-Apr-2024 05:00:46 GMT; secure; SameSite=None; Secure", + "session_tracker=eodebbifabkglfmbpj.0.1648962045893.Z0FBQUFBQmlTU24tZzBJNnF4ZWNaNkdJV3llV0UyRzZMQ3RYMGV1LVkxZXEyUDJ3SFpXY1FoV0hEeHBNVnU3R2JPR2tGUG84VjN2YmlrMVNxWDNRZDk2Z1lIYTFKX3pGYndIUGdCWlZpZUZQLTFuR29oVFRHOGxpNWJQMFFka1U5LUNnQkl5bS1fVk0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 07:00:46 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 02-Apr-2025 05:00:45 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/jlbw48/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T05:00:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=W4LvH3G38pYgRHKXfw; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU24tSURyUmtEUWJZU0Zpb2M3S0RMbDJoa3hiaFgtc0VIbVR6Tm5JM0R2T2d1bXRNeTg5YkdwbXM4YzJzZTJOOWJwaHhyYjQxNlo5cGR2SWw2bUtib2swdG9ORk9VWGVpd1pRd1k0U0otMm5JYllkcjZmVDBCcXh2TFU0eUxxbDBtdEI; redesign_optout=true; session_tracker=eodebbifabkglfmbpj.0.1648962045893.Z0FBQUFBQmlTU24tZzBJNnF4ZWNaNkdJV3llV0UyRzZMQ3RYMGV1LVkxZXEyUDJ3SFpXY1FoV0hEeHBNVnU3R2JPR2tGUG84VjN2YmlrMVNxWDNRZDk2Z1lIYTFKX3pGYndIUGdCWlZpZUZQLTFuR29oVFRHOGxpNWJQMFFka1U5LUNnQkl5bS1fVk0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=SubTestBot1%2CSubTestBot1%2CSubTestBot1%2CSubTestBot1&users=Watchful1%2Cwatchful12%2Cspez%2CWatchful1BotTest&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_f88e2a6c-3776-42c4-976b-7062ab1fba03\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648620243, \"type\": \"NOTE\"}, null, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "882" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 05:00:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=eodebbifabkglfmbpj.0.1648962046187.Z0FBQUFBQmlTU24tTlUzQ0NmcFlRZHNDaEtXcjY3bXgzRjcwTmYzZWp6S2xTRE51eXRhTnhKcC1Uel91dWZ0QkM3eEJoXzV6RlZORmgyRk9nRmNrOFB1MGNoelc0Q0N2a2ZVSkUwbENBa3prV1Jfa25Wb2F1TEt5ZDdmTEpWSWRWdG5sb1VJZGpNeFk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 07:00:46 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "598.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "2" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=SubTestBot1%2CSubTestBot1%2CSubTestBot1%2CSubTestBot1&users=Watchful1%2Cwatchful12%2Cspez%2CWatchful1BotTest&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestReddit.test_notes__things.json b/tests/integration/cassettes/TestReddit.test_notes__things.json new file mode 100644 index 000000000..c698889aa --- /dev/null +++ b/tests/integration/cassettes/TestReddit.test_notes__things.json @@ -0,0 +1,311 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:39:17", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=IGp0heqROQqKMMU14I; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "284" + ], + "x-ratelimit-reset": [ + "43" + ], + "x-ratelimit-used": [ + "16" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-03-30T05:39:18", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=IGp0heqROQqKMMU14I" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": 1648351390, \"subreddit\": \"\", \"selftext\": \"test\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"test post by watchful12\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_tpbemz\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"subreddit_type\": \"public\", \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": \"bb18a014-3b06-11e9-bc95-0e63402c743c\", \"is_original_content\": false, \"author_fullname\": \"t2_j3r75\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": \"Watchful1\", \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": \"test 1123\", \"author_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 123\"}], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"mod_note\": null, \"created\": 1648351304.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"likes\": null, \"suggested_sort\": null, \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": \"test 123\", \"treatment_tags\": [], \"visited\": true, \"removed_by\": null, \"num_reports\": 0, \"distinguished\": null, \"subreddit_id\": \"t5_3fib0\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"tpbemz\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Watchful12\", \"discussion_type\": null, \"num_comments\": 0, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": true, \"author_flair_text_color\": \"dark\", \"permalink\": \"/r//comments/tpbemz/test_post_by_watchful12/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/tpbemz/test_post_by_watchful12/\", \"subreddit_subscribers\": 13, \"created_utc\": 1648351304.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "3179" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTBHNjNnZnN2NHZ1b242U1N2Q1lDSHdac3p5SlFjaHJsLVpkNHJQZEdkbmxfRWlJRFZCSmJiOHZMVHRYUnBIaDRxQzVLNUlqZGF5a0ptWlRfT1lzblZOaWkxYTVGaFR2WmVUU2MtRldEemd0UHRrRTBrbXB5a2laMjRoTFBWREFDWjc; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:39:18 GMT; secure; SameSite=None; Secure", + "session_tracker=qhkcclkinnlcpnrjoq.0.1648618758183.Z0FBQUFBQmlRLTBHTkNzUnlLc1Q2NVB4ZUh6Wmd0Tl9uUk54VXktRi0zTWNUanU5eUlCT0VKZ3E1YUxoUE1tQ0xXSVp2M2IzM1VmdU1BQmNDOGEzU3hHdEtsbENpYXNiLXBaRzZOaWRIM0ptTzRzQ3ZiNHBhSmotU1liVUQtRFZOMW1NY0pveWN1ek0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:39:18 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Sat, 29-Mar-2025 05:39:18 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "557.0" + ], + "x-ratelimit-reset": [ + "42" + ], + "x-ratelimit-used": [ + "43" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:39:18", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=IGp0heqROQqKMMU14I; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTBHNjNnZnN2NHZ1b242U1N2Q1lDSHdac3p5SlFjaHJsLVpkNHJQZEdkbmxfRWlJRFZCSmJiOHZMVHRYUnBIaDRxQzVLNUlqZGF5a0ptWlRfT1lzblZOaWkxYTVGaFR2WmVUU2MtRldEemd0UHRrRTBrbXB5a2laMjRoTFBWREFDWjc; redesign_optout=true; session_tracker=qhkcclkinnlcpnrjoq.0.1648618758183.Z0FBQUFBQmlRLTBHTkNzUnlLc1Q2NVB4ZUh6Wmd0Tl9uUk54VXktRi0zTWNUanU5eUlCT0VKZ3E1YUxoUE1tQ0xXSVp2M2IzM1VmdU1BQmNDOGEzU3hHdEtsbENpYXNiLXBaRzZOaWRIM0ptTzRzQ3ZiNHBhSmotU1liVUQtRFZOMW1NY0pveWN1ek0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Watchful12&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2af06395-cf36-4cdc-82fc-a19694e01234\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648618694, \"cursor\": \"MTY0ODYxODY5NDI3NQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"unmuteuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_7ec157a2-ad7d-11ec-9b93-9989b85cc752\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351505, \"cursor\": \"MTY0ODM1MTUwNTA3Ng==\", \"type\": \"MUTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"unbanuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": \"was temporary\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_7be39fe4-ad7d-11ec-bb7c-63eb743d0b31\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351500, \"cursor\": \"MTY0ODM1MTUwMDI2Nw==\", \"type\": \"BAN\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"muteuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": \"test\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5a5fea5e-ad7d-11ec-87a5-fb058d9ef580\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351444, \"cursor\": \"MTY0ODM1MTQ0NDAzOQ==\", \"type\": \"MUTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"banuser\", \"reddit_id\": \"t2_j3r75\", \"details\": \"permanent\", \"description\": \"other: test ban\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_53e939f4-ad7d-11ec-9e1b-45fc86e2d94b\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351433, \"cursor\": \"MTY0ODM1MTQzMzE5NQ==\", \"type\": \"BAN\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"approvelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"unspam\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_3a48541c-ad7d-11ec-953d-45e115bb1f3b\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351390, \"cursor\": \"MTY0ODM1MTM5MDE5Nw==\", \"type\": \"APPROVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"removelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"remove\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_35f07d8a-ad7d-11ec-a7a2-2130535e7279\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351382, \"cursor\": \"MTY0ODM1MTM4MjkxMQ==\", \"type\": \"REMOVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"approvelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"confirm_ham\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2d4ee328-ad7d-11ec-9917-c909a9f60748\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351368, \"cursor\": \"MTY0ODM1MTM2ODQzMA==\", \"type\": \"APPROVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_60c142bb-d0b8-4549-a97f-d78fd7d25675\", \"user_note_data\": {\"note\": \"second note with no label, no post\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351353, \"cursor\": \"MTY0ODM1MTM1MzIwNg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_fa289d6b-c62e-42aa-9f58-177fb61ab166\", \"user_note_data\": {\"note\": \"initial note with label on post\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"ABUSE_WARNING\"}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351336, \"cursor\": \"MTY0ODM1MTMzNjk1NQ==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY0ODYxODY5NDI3NQ==\", \"end_cursor\": \"MTY0ODM1MTMzNjk1NQ==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4895" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=qhkcclkinnlcpnrjoq.0.1648618758380.Z0FBQUFBQmlRLTBHaEZVWWVJZXFsZVo2NktsTm1TQnl1czdfTjBHSDlHWlc0bXhvRUNTbjg0ZU1STFlTZHhTS0NvWlF5MjgxNWJ0SWtvV3hidkZoelE5RUNYODJCV2JUMXJBN2ZQLUJSaUNQRTB3LTdRSTZNTGdFOVgzYzRoX3FiV2cyaDljMnZtU0o; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:39:18 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "556.0" + ], + "x-ratelimit-reset": [ + "42" + ], + "x-ratelimit-used": [ + "44" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Watchful12&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestRedditor.test_get_bulk_notes.json b/tests/integration/cassettes/TestRedditor.test_get_bulk_notes.json new file mode 100644 index 000000000..38ddc33e4 --- /dev/null +++ b/tests/integration/cassettes/TestRedditor.test_get_bulk_notes.json @@ -0,0 +1,310 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-02T05:50:15", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=nZ2J81SdOTmoKJRyxW" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t2\", \"data\": {\"is_employee\": false, \"has_visited_new_profile\": false, \"is_friend\": false, \"pref_no_profanity\": false, \"has_external_account\": false, \"pref_geopopular\": \"GLOBAL\", \"pref_show_trending\": false, \"subreddit\": {\"default_set\": true, \"user_is_contributor\": false, \"banner_img\": \"\", \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": true, \"community_icon\": null, \"show_media\": true, \"icon_color\": \"\", \"user_is_muted\": false, \"display_name\": \"u_Watchful1\", \"header_img\": null, \"title\": \"\", \"coins\": 0, \"previous_names\": [], \"over_18\": false, \"icon_size\": [256, 256], \"primary_color\": \"\", \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"description\": \"\", \"submit_link_label\": \"\", \"header_size\": null, \"restrict_commenting\": false, \"subscribers\": 156, \"submit_text_label\": \"\", \"is_default_icon\": false, \"link_flair_position\": \"\", \"display_name_prefixed\": \"u/Watchful1\", \"key_color\": \"\", \"name\": \"t5_1tpu9w\", \"is_default_banner\": true, \"url\": \"/user/Watchful1/\", \"quarantine\": false, \"banner_size\": null, \"user_is_moderator\": true, \"accept_followers\": true, \"public_description\": \"Runs u/RemindMeBot and u/UpdateMeBot, moderates r/CompetitiveOverwatch. Happy to answer any python/praw questions\", \"link_flair_enabled\": false, \"disable_contributor_requests\": false, \"subreddit_type\": \"user\", \"user_is_subscriber\": false}, \"pref_show_presence\": false, \"snoovatar_img\": \"\", \"snoovatar_size\": null, \"gold_expiration\": 1708295531, \"has_gold_subscription\": true, \"is_sponsor\": false, \"num_friends\": 0, \"features\": {\"mod_service_mute_writes\": true, \"promoted_trend_blanks\": true, \"show_amp_link\": true, \"top_content_email_digest_v2\": {\"owner\": \"growth\", \"variant\": \"control_1\", \"experiment_id\": 363}, \"chat\": true, \"is_email_permission_required\": false, \"mod_awards\": true, \"expensive_coins_package\": true, \"mweb_xpromo_revamp_v2\": {\"owner\": \"growth\", \"variant\": \"treatment_6\", \"experiment_id\": 457}, \"awards_on_streams\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_ios\": true, \"chat_subreddit\": true, \"cookie_consent_banner\": true, \"modlog_copyright_removal\": true, \"do_not_track\": true, \"mod_service_mute_reads\": true, \"chat_user_settings\": true, \"use_pref_account_deployment\": true, \"mweb_xpromo_interstitial_comments_ios\": true, \"noreferrer_to_noopener\": true, \"premium_subscriptions_table\": true, \"mweb_xpromo_interstitial_comments_android\": true, \"crowd_control_for_post\": true, \"chat_group_rollout\": true, \"resized_styles_images\": true, \"spez_modal\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_android\": true}, \"can_edit_name\": false, \"is_blocked\": false, \"verified\": true, \"new_modmail_exists\": false, \"pref_autoplay\": false, \"coins\": 35585, \"has_paypal_subscription\": false, \"has_subscribed_to_premium\": true, \"id\": \"d0z23\", \"can_create_subreddit\": true, \"over_18\": true, \"is_gold\": true, \"is_mod\": true, \"awarder_karma\": 3884, \"suspension_expiration_utc\": null, \"has_stripe_subscription\": true, \"is_suspended\": false, \"pref_video_autoplay\": false, \"in_chat\": true, \"has_android_subscription\": false, \"in_redesign_beta\": false, \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"has_mod_mail\": false, \"pref_nightmode\": false, \"awardee_karma\": 4033, \"hide_from_robots\": false, \"password_set\": true, \"modhash\": null, \"link_karma\": 50781, \"force_password_reset\": false, \"total_karma\": 265351, \"inbox_count\": 0, \"pref_top_karma_subreddits\": false, \"has_mail\": false, \"pref_show_snoovatar\": false, \"name\": \"Watchful1\", \"pref_clickgadget\": 5, \"created\": 1378424297.0, \"has_verified_email\": true, \"gold_creddits\": 0, \"created_utc\": 1378424297.0, \"has_ios_subscription\": false, \"pref_show_twitter\": false, \"in_beta\": false, \"comment_karma\": 206653, \"accept_followers\": true, \"has_subscribed\": true}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4040" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:50:14 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSLVFXanh5Q1RPX1FnenVPNmV1X3FBRDNTUVJoVS1TVkxzYlRNZXhKcm13cndSX3hyT003aUhseWRIY0pUMnYwTldkNGs0aVBlc0VUNUxyVjdkMmt0NkxzTDYtSXRYZ0I3cmY4Y2U3YUo5MGJfc2h2czEzM0Rvd1ZOT0NWVFhtRlBhTTk; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 05:50:14 GMT; secure; SameSite=None; Secure", + "session_tracker=fheeracbrmmfgermal.0.1648878614820.Z0FBQUFBQmlSLVFXVVlpRWs4LUFwVnVpbEpnTWZtdVhHOEdmVWJCWTczelROc3ZlYVJ2dzVsUkVmME1YaUxaelgtQ1V2QVBHV2REUU1CTnE4WjhkUE40cmtpMWpvOE43NWJBT0IybG5yM1VhZDUtenF0ekxPWVRrZy1vcXBJQkEyYlluVzRzODFaZWc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 07:50:14 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Tue, 01-Apr-2025 05:50:14 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "586" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + } + }, + { + "recorded_at": "2022-04-02T06:04:01", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 06:04:01 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=xCleut8glh4DrJfWeR; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "298" + ], + "x-ratelimit-reset": [ + "359" + ], + "x-ratelimit-used": [ + "2" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-02T06:04:02", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=xCleut8glh4DrJfWeR" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot2&users=Watchful1%2CWatchful1&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "442" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 06:04:01 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSLWRSNWhRRXlTRko4cElfWTFuNENXMjRwYkxWaTlwSkh1bWlmUGhfUE9lUndfbXAyY1ZpRk1QcjhndEpzMnR2aUtZbDZEeU1RRDgtUU9tOXhYcDZrLWNyUTBsTzB1ZHE0enViRzREbDB1VmJ1bnM2SzhBZVRGR1lIYXUwcmo3Z0NscGQ; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 06:04:01 GMT; secure; SameSite=None; Secure", + "session_tracker=prhdpnnjgfgfbbfpmm.0.1648879441641.Z0FBQUFBQmlSLWRSUG10d2NxUVhoNV9oSExKdTQ0b3gwdVRfbnNoVy1raTlXRGlhRkRWX0ljQlN2NnBrS0QyRU10WVNleTZIUDlnUEVJS1FfVG5CS212SHUyX09zRVgzSHk2d3c3OHZoTXltSHhod2N4TV9RTWxNSGFUbEF2bHBGUTRUV0FBTUVkZW8; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 08:04:01 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "582.0" + ], + "x-ratelimit-reset": [ + "359" + ], + "x-ratelimit-used": [ + "18" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot2&users=Watchful1%2CWatchful1&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestRedditor.test_notes__subreddits.json b/tests/integration/cassettes/TestRedditor.test_notes__subreddits.json new file mode 100644 index 000000000..38ddc33e4 --- /dev/null +++ b/tests/integration/cassettes/TestRedditor.test_notes__subreddits.json @@ -0,0 +1,310 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-02T05:50:15", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=nZ2J81SdOTmoKJRyxW" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t2\", \"data\": {\"is_employee\": false, \"has_visited_new_profile\": false, \"is_friend\": false, \"pref_no_profanity\": false, \"has_external_account\": false, \"pref_geopopular\": \"GLOBAL\", \"pref_show_trending\": false, \"subreddit\": {\"default_set\": true, \"user_is_contributor\": false, \"banner_img\": \"\", \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": true, \"community_icon\": null, \"show_media\": true, \"icon_color\": \"\", \"user_is_muted\": false, \"display_name\": \"u_Watchful1\", \"header_img\": null, \"title\": \"\", \"coins\": 0, \"previous_names\": [], \"over_18\": false, \"icon_size\": [256, 256], \"primary_color\": \"\", \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"description\": \"\", \"submit_link_label\": \"\", \"header_size\": null, \"restrict_commenting\": false, \"subscribers\": 156, \"submit_text_label\": \"\", \"is_default_icon\": false, \"link_flair_position\": \"\", \"display_name_prefixed\": \"u/Watchful1\", \"key_color\": \"\", \"name\": \"t5_1tpu9w\", \"is_default_banner\": true, \"url\": \"/user/Watchful1/\", \"quarantine\": false, \"banner_size\": null, \"user_is_moderator\": true, \"accept_followers\": true, \"public_description\": \"Runs u/RemindMeBot and u/UpdateMeBot, moderates r/CompetitiveOverwatch. Happy to answer any python/praw questions\", \"link_flair_enabled\": false, \"disable_contributor_requests\": false, \"subreddit_type\": \"user\", \"user_is_subscriber\": false}, \"pref_show_presence\": false, \"snoovatar_img\": \"\", \"snoovatar_size\": null, \"gold_expiration\": 1708295531, \"has_gold_subscription\": true, \"is_sponsor\": false, \"num_friends\": 0, \"features\": {\"mod_service_mute_writes\": true, \"promoted_trend_blanks\": true, \"show_amp_link\": true, \"top_content_email_digest_v2\": {\"owner\": \"growth\", \"variant\": \"control_1\", \"experiment_id\": 363}, \"chat\": true, \"is_email_permission_required\": false, \"mod_awards\": true, \"expensive_coins_package\": true, \"mweb_xpromo_revamp_v2\": {\"owner\": \"growth\", \"variant\": \"treatment_6\", \"experiment_id\": 457}, \"awards_on_streams\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_ios\": true, \"chat_subreddit\": true, \"cookie_consent_banner\": true, \"modlog_copyright_removal\": true, \"do_not_track\": true, \"mod_service_mute_reads\": true, \"chat_user_settings\": true, \"use_pref_account_deployment\": true, \"mweb_xpromo_interstitial_comments_ios\": true, \"noreferrer_to_noopener\": true, \"premium_subscriptions_table\": true, \"mweb_xpromo_interstitial_comments_android\": true, \"crowd_control_for_post\": true, \"chat_group_rollout\": true, \"resized_styles_images\": true, \"spez_modal\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_android\": true}, \"can_edit_name\": false, \"is_blocked\": false, \"verified\": true, \"new_modmail_exists\": false, \"pref_autoplay\": false, \"coins\": 35585, \"has_paypal_subscription\": false, \"has_subscribed_to_premium\": true, \"id\": \"d0z23\", \"can_create_subreddit\": true, \"over_18\": true, \"is_gold\": true, \"is_mod\": true, \"awarder_karma\": 3884, \"suspension_expiration_utc\": null, \"has_stripe_subscription\": true, \"is_suspended\": false, \"pref_video_autoplay\": false, \"in_chat\": true, \"has_android_subscription\": false, \"in_redesign_beta\": false, \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"has_mod_mail\": false, \"pref_nightmode\": false, \"awardee_karma\": 4033, \"hide_from_robots\": false, \"password_set\": true, \"modhash\": null, \"link_karma\": 50781, \"force_password_reset\": false, \"total_karma\": 265351, \"inbox_count\": 0, \"pref_top_karma_subreddits\": false, \"has_mail\": false, \"pref_show_snoovatar\": false, \"name\": \"Watchful1\", \"pref_clickgadget\": 5, \"created\": 1378424297.0, \"has_verified_email\": true, \"gold_creddits\": 0, \"created_utc\": 1378424297.0, \"has_ios_subscription\": false, \"pref_show_twitter\": false, \"in_beta\": false, \"comment_karma\": 206653, \"accept_followers\": true, \"has_subscribed\": true}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4040" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:50:14 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSLVFXanh5Q1RPX1FnenVPNmV1X3FBRDNTUVJoVS1TVkxzYlRNZXhKcm13cndSX3hyT003aUhseWRIY0pUMnYwTldkNGs0aVBlc0VUNUxyVjdkMmt0NkxzTDYtSXRYZ0I3cmY4Y2U3YUo5MGJfc2h2czEzM0Rvd1ZOT0NWVFhtRlBhTTk; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 05:50:14 GMT; secure; SameSite=None; Secure", + "session_tracker=fheeracbrmmfgermal.0.1648878614820.Z0FBQUFBQmlSLVFXVVlpRWs4LUFwVnVpbEpnTWZtdVhHOEdmVWJCWTczelROc3ZlYVJ2dzVsUkVmME1YaUxaelgtQ1V2QVBHV2REUU1CTnE4WjhkUE40cmtpMWpvOE43NWJBT0IybG5yM1VhZDUtenF0ekxPWVRrZy1vcXBJQkEyYlluVzRzODFaZWc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 07:50:14 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Tue, 01-Apr-2025 05:50:14 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "586" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + } + }, + { + "recorded_at": "2022-04-02T06:04:01", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 06:04:01 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=xCleut8glh4DrJfWeR; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "298" + ], + "x-ratelimit-reset": [ + "359" + ], + "x-ratelimit-used": [ + "2" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-02T06:04:02", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=xCleut8glh4DrJfWeR" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot2&users=Watchful1%2CWatchful1&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "442" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 06:04:01 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSLWRSNWhRRXlTRko4cElfWTFuNENXMjRwYkxWaTlwSkh1bWlmUGhfUE9lUndfbXAyY1ZpRk1QcjhndEpzMnR2aUtZbDZEeU1RRDgtUU9tOXhYcDZrLWNyUTBsTzB1ZHE0enViRzREbDB1VmJ1bnM2SzhBZVRGR1lIYXUwcmo3Z0NscGQ; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 06:04:01 GMT; secure; SameSite=None; Secure", + "session_tracker=prhdpnnjgfgfbbfpmm.0.1648879441641.Z0FBQUFBQmlSLWRSUG10d2NxUVhoNV9oSExKdTQ0b3gwdVRfbnNoVy1raTlXRGlhRkRWX0ljQlN2NnBrS0QyRU10WVNleTZIUDlnUEVJS1FfVG5CS212SHUyX09zRVgzSHk2d3c3OHZoTXltSHhod2N4TV9RTWxNSGFUbEF2bHBGUTRUV0FBTUVkZW8; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 08:04:01 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "582.0" + ], + "x-ratelimit-reset": [ + "359" + ], + "x-ratelimit-used": [ + "18" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot2&users=Watchful1%2CWatchful1&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubmissionModeration.test_notes.json b/tests/integration/cassettes/TestSubmissionModeration.test_notes.json new file mode 100644 index 000000000..5ab814427 --- /dev/null +++ b/tests/integration/cassettes/TestSubmissionModeration.test_notes.json @@ -0,0 +1,415 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-05-01T23:23:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "78" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"refresh_token\": \"\", \"scope\": \"creddits modnote modcontributors modmail modconfig subscribe structuredstyles vote wikiedit mysubreddits submit modlog modposts modflair save modothers adsconversions read privatemessages report identity livemanage account modtraffic wikiread edit modwiki modself flair history\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Cache-Control": [ + "private, max-age=3600" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "454" + ], + "Date": [ + "Sun, 01 May 2022 23:23:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=qiRwbuJ9C1sKzuNuhI; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "394" + ], + "x-ratelimit-used": [ + "1" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-05-01T23:23:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=qiRwbuJ9C1sKzuNuhI" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": null, \"subreddit\": \"\", \"selftext\": \"\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"Test post\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_uflrmv\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": null, \"is_original_content\": false, \"author_fullname\": \"t2_75u2lqkb\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": null, \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": null, \"previous_visits\": [1651360399.0, 1651442416.0, 1651444076.0], \"author_flair_richtext\": [], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1651358011.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": null, \"likes\": null, \"suggested_sort\": \"top\", \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": null, \"treatment_tags\": [], \"visited\": false, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_29ey0j\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": 0, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"uflrmv\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Lil_SpazTest\", \"discussion_type\": null, \"num_comments\": 1, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": false, \"author_flair_text_color\": null, \"permalink\": \"/r//comments/uflrmv/test_post/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/uflrmv/test_post/\", \"subreddit_subscribers\": 2, \"created_utc\": 1651358011.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t1\", \"data\": {\"author_flair_background_color\": null, \"subreddit_id\": \"t5_29ey0j\", \"approved_at_utc\": null, \"author_is_blocked\": false, \"comment_type\": null, \"awarders\": [], \"mod_reason_by\": null, \"banned_by\": null, \"author_flair_type\": \"text\", \"total_awards_received\": 0, \"subreddit\": \"\", \"removed\": false, \"author_flair_template_id\": null, \"likes\": null, \"replies\": \"\", \"user_reports\": [], \"saved\": false, \"id\": \"i6yklz7\", \"banned_at_utc\": null, \"mod_reason_title\": null, \"gilded\": 0, \"archived\": false, \"collapsed_reason_code\": null, \"no_follow\": true, \"spam\": false, \"can_mod_post\": true, \"send_replies\": true, \"parent_id\": \"t3_uflrmv\", \"score\": 1, \"author_fullname\": \"t2_75u2lqkb\", \"removal_reason\": null, \"approved_by\": null, \"mod_note\": null, \"all_awardings\": [], \"collapsed\": false, \"body\": \"test reply\", \"edited\": false, \"top_awarded_type\": null, \"author_flair_css_class\": null, \"name\": \"t1_i6yklz7\", \"is_submitter\": true, \"downs\": 0, \"author_flair_richtext\": [], \"author_patreon_flair\": false, \"body_html\": \"\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest reply\\u003C/p\\u003E\\n\\u003C/div\\u003E\", \"gildings\": {}, \"collapsed_reason\": null, \"distinguished\": null, \"associated_award\": null, \"stickied\": false, \"author_premium\": false, \"can_gild\": true, \"link_id\": \"t3_uflrmv\", \"unrepliable_reason\": null, \"approved\": false, \"author_flair_text_color\": null, \"score_hidden\": false, \"permalink\": \"/r//comments/uflrmv/test_post/i6yklz7/\", \"subreddit_type\": \"public\", \"locked\": false, \"report_reasons\": [], \"created\": 1651444641.0, \"author_flair_text\": null, \"treatment_tags\": [], \"author\": \"Lil_SpazTest\", \"created_utc\": 1651444641.0, \"subreddit_name_prefixed\": \"r/\", \"controversiality\": 0, \"depth\": 0, \"ignore_reports\": false, \"collapsed_because_crowd_control\": null, \"mod_reports\": [], \"num_reports\": 0, \"ups\": 1}}], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4810" + ], + "Date": [ + "Sun, 01 May 2022 23:23:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFp1Uks0YmRyY3kwMVVMRnhRT19CSTBkUVdIVlJoQ3ktSllRTmFwVlNISWtaN0t1RnRRdFFfZDAtN3ltdEE2MlIwYXVnWjBDZExhVGFLRUF4VEctWGk1X3MyYmxsT3cxRk9mLTJyRGZSMF95UHBIdmlUdW1QY3pySUpWeUxCWENJLXc; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 30-Apr-2024 23:23:26 GMT; secure; SameSite=None; Secure", + "session_tracker=lmdqlkipierbnhdilc.0.1651447406456.Z0FBQUFBQmlieFp1c0l3VmFsb2JvNXZFTW12WjNpMXpOSTNIOGxMSnFaSkZ4cWIwQXVjVnhFWnFRZjVGOEJrczFINE5TZ2JRRnE4Wm83TUZ5WUpBSEhuTTFVRVk2SzBJOEdaWXdhajJMNUF1TEpTYkRySGhNNzVUc0VnVmxTcExlemctVy1iQy1SNWg; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:23:26 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Wed, 30-Apr-2025 23:23:26 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "599.0" + ], + "x-ratelimit-reset": [ + "394" + ], + "x-ratelimit-used": [ + "1" + ], + "x-ua-compatible": [ + "IE=edge" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/uflrmv/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T23:23:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json&label=HELPFUL_USER¬e=test+note&reddit_id=t3_uflrmv&subreddit=&user=Lil_SpazTest" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "103" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "csv=2; edgebucket=qiRwbuJ9C1sKzuNuhI; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFp1Uks0YmRyY3kwMVVMRnhRT19CSTBkUVdIVlJoQ3ktSllRTmFwVlNISWtaN0t1RnRRdFFfZDAtN3ltdEE2MlIwYXVnWjBDZExhVGFLRUF4VEctWGk1X3MyYmxsT3cxRk9mLTJyRGZSMF95UHBIdmlUdW1QY3pySUpWeUxCWENJLXc; redesign_optout=true; session_tracker=lmdqlkipierbnhdilc.0.1651447406456.Z0FBQUFBQmlieFp1c0l3VmFsb2JvNXZFTW12WjNpMXpOSTNIOGxMSnFaSkZ4cWIwQXVjVnhFWnFRZjVGOEJrczFINE5TZ2JRRnE4Wm83TUZ5WUpBSEhuTTFVRVk2SzBJOEdaWXdhajJMNUF1TEpTYkRySGhNNzVUc0VnVmxTcExlemctVy1iQy1SNWg" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_6b2cb0d6-d680-43c8-bb11-6978b554fe02\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651447406, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "461" + ], + "Date": [ + "Sun, 01 May 2022 23:23:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=lmdqlkipierbnhdilc.0.1651447406651.Z0FBQUFBQmlieFp1UHhGX0FPM3lyUXlDazROaS1UV0gxOGlpSmw3cDlFaldaTUlxR2NwS3V4SExoTGVVN21LMndFTy1FRG90dldTUVpzendJWDdSSkZZc3d2ZTlzbE1MMUNnZktGT3FOakVSZ1V2d0dhSWRjYU16X28zQWRKbnBfeFZtVGZqaHJXNTk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:23:26 GMT; secure" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "598.0" + ], + "x-ratelimit-reset": [ + "394" + ], + "x-ratelimit-used": [ + "2" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-05-01T23:23:26", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=qiRwbuJ9C1sKzuNuhI; loid=0000000000000o77bz.2.1434669370561.Z0FBQUFBQmlieFp1Uks0YmRyY3kwMVVMRnhRT19CSTBkUVdIVlJoQ3ktSllRTmFwVlNISWtaN0t1RnRRdFFfZDAtN3ltdEE2MlIwYXVnWjBDZExhVGFLRUF4VEctWGk1X3MyYmxsT3cxRk9mLTJyRGZSMF95UHBIdmlUdW1QY3pySUpWeUxCWENJLXc; redesign_optout=true; session_tracker=lmdqlkipierbnhdilc.0.1651447406651.Z0FBQUFBQmlieFp1UHhGX0FPM3lyUXlDazROaS1UV0gxOGlpSmw3cDlFaldaTUlxR2NwS3V4SExoTGVVN21LMndFTy1FRG90dldTUVpzendJWDdSSkZZc3d2ZTlzbE1MMUNnZktGT3FOakVSZ1V2d0dhSWRjYU16X28zQWRKbnBfeFZtVGZqaHJXNTk" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Lil_SpazTest&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_6b2cb0d6-d680-43c8-bb11-6978b554fe02\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651447406, \"cursor\": \"MTY1MTQ0NzQwNjY3MQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t1_i6yklz7\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_4a31835b-658e-4fea-8cee-429a41276cd4\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t1_i6yklz7\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651446779, \"cursor\": \"MTY1MTQ0Njc3OTU2Mg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_c5fe5eb8-e7a2-43d7-9e74-29aa8e7aabef\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444166, \"cursor\": \"MTY1MTQ0NDE2NjI5NQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_46c71397-75cf-4e65-bc1a-47dc783736d8\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651444076, \"cursor\": \"MTY1MTQ0NDA3NjI0Nw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_5362e80d-e2db-4f44-a7bf-0d635d02d506\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651361095, \"cursor\": \"MTY1MTM2MTA5NTE2MQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_656bc570-d2eb-46f6-8915-2a818f6d056d\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360720, \"cursor\": \"MTY1MTM2MDcyMDIxMQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_59f79e52-0841-41ed-81d8-5f220d2080a4\", \"user_note_data\": {\"note\": \"test\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360508, \"cursor\": \"MTY1MTM2MDUwODk2MQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_uflrmv\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_1c2829ed-8398-4009-86c4-43009a2ff02c\", \"user_note_data\": {\"note\": \"test\", \"reddit_id\": \"t3_uflrmv\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360459, \"cursor\": \"MTY1MTM2MDQ1OTkyMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_29ey0j\", \"operator_id\": \"t2_o77bz\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Lil_SpazTest\", \"operator\": \"\", \"id\": \"ModNote_2d06bbeb-eb8f-40a1-a306-18572302c9fb\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_75u2lqkb\", \"created_at\": 1651360253, \"cursor\": \"MTY1MTM2MDI1MzU3Ng==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY1MTQ0NzQwNjY3MQ==\", \"end_cursor\": \"MTY1MTM2MDI1MzU3Ng==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4451" + ], + "Date": [ + "Sun, 01 May 2022 23:23:26 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=lmdqlkipierbnhdilc.0.1651447406800.Z0FBQUFBQmlieFp1ZkNWal94Sk9TSjVkS2pMQVJFck91djh5Ym9GTnIycm1BZU95OXhiMV9jd3ZYejYwZzRVUWhzYUl4aHhXYVlOczNSUEh5cHF0NTdSTEVZVmpUNlNpekdfcllsVmxYZ1RCVnBpZTBrSWdPVGdvdDUyM1BrWlN0cC0zSnNOcTMyMDI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 02-May-2022 01:23:26 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "X-XSS-Protection": [ + "1; mode=block" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store" + ], + "content-type": [ + "application/json; charset=UTF-8" + ], + "expires": [ + "-1" + ], + "x-moose": [ + "majestic" + ], + "x-ratelimit-remaining": [ + "597.0" + ], + "x-ratelimit-reset": [ + "394" + ], + "x-ratelimit-used": [ + "3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Lil_SpazTest&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditModeration.test_notes.json b/tests/integration/cassettes/TestSubredditModeration.test_notes.json new file mode 100644 index 000000000..0e8516699 --- /dev/null +++ b/tests/integration/cassettes/TestSubredditModeration.test_notes.json @@ -0,0 +1,407 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:43:14", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=8CVxVn4dfIIIjoptdC" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=%2C%2C&users=Watchful1%2Cwatchful12%2Cspez&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2af06395-cf36-4cdc-82fc-a19694e01234\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648618694, \"type\": \"NOTE\"}, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "876" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:43:14 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTN5Y2pVU0VqWVRtc3ZzaVBMWC1MVy0xcjFSRGttcGE2ZkxEMUNfMi1HLWpVWkpXaGJJQW1MbzBhOTdESVA4MllWOVRLamJIUGFITjlqRVlpT05lcURXdWd3T2JtMGtxUWg4S09BNjNfTG5VOTJ3enA0VmFjTmp1X182SnRsUTl6b0Y; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:43:14 GMT; secure; SameSite=None; Secure", + "session_tracker=jkdhmrgremkhlgpjgr.0.1648618994516.Z0FBQUFBQmlRLTN5VVFSYVExMXZmTVA2ZU9TUXFmTGhVUENsQllIQVMxdlJEc0I4S19tNTB2Yk5mYmNzc2JKTVNnVkhRZ0xpVXNsSkZtLTFLcGUyY2k5SnhoSVduTlByOFF5NHlQTFdoY1hnT0hnQmFvRUZ6b0o0UzQ0UnNwVFo2cUpPLXU1UVdOUEI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:43:14 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "406" + ], + "x-ratelimit-used": [ + "15" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=%2C%2C&users=Watchful1%2Cwatchful12%2Cspez&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=4PZwoKMhJTJ3ewxksp; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=4PZwoKMhJTJ3ewxksp" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=%2C&users=Watchful1%2Cwatchful12&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_f88e2a6c-3776-42c4-976b-7062ab1fba03\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648620243, \"type\": \"NOTE\"}]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "870" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU1ZPUjFIWkFXWGpWWlM2bDNCYWVRcUFKWlhwRWpYUDh1eTN1OFRfT2V2c2xILUptUXhMSHU5b3dxdGhVMlNLcFVoTVBSN0xUTmh2ZFRxQ1h6dXYxWFdUSEd1dHdWTDVzTGx6MVpqb0VmTk5ZOE0zMWpKT1N2VzUzeC1jTmNqMUpDN3g; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 02-Apr-2024 04:40:46 GMT; secure; SameSite=None; Secure", + "session_tracker=hropqbnfdhgdallkpd.0.1648960846000.Z0FBQUFBQmlTU1ZPUWtkWDBrQi12Wm94T084RkpycUJlRzluUEhZTFZBUXhfN0wxNUdNMVRuUFFqY3V4elQwRHFSTXBEa21jbVY1V3Y3TjhHMl85amtVNEI3alFOUzJnbGF4a29rYUc0QzM1REwtOXhiU2VER1lnWUlUNkt5bVlQamJ0MnhwaXNBaWw; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 06:40:46 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "596.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "4" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=%2C&users=Watchful1%2Cwatchful12&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=4PZwoKMhJTJ3ewxksp; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU1ZPUjFIWkFXWGpWWlM2bDNCYWVRcUFKWlhwRWpYUDh1eTN1OFRfT2V2c2xILUptUXhMSHU5b3dxdGhVMlNLcFVoTVBSN0xUTmh2ZFRxQ1h6dXYxWFdUSEd1dHdWTDVzTGx6MVpqb0VmTk5ZOE0zMWpKT1N2VzUzeC1jTmNqMUpDN3g; session_tracker=hropqbnfdhgdallkpd.0.1648960846000.Z0FBQUFBQmlTU1ZPUWtkWDBrQi12Wm94T084RkpycUJlRzluUEhZTFZBUXhfN0wxNUdNMVRuUFFqY3V4elQwRHFSTXBEa21jbVY1V3Y3TjhHMl85amtVNEI3alFOUzJnbGF4a29rYUc0QzM1REwtOXhiU2VER1lnWUlUNkt5bVlQamJ0MnhwaXNBaWw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=spez&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=hropqbnfdhgdallkpd.0.1648960846131.Z0FBQUFBQmlTU1ZPVGdHWmZ3dVZlVTk2MlNSUVVTdTdSblJMVkJueFFsSEdEV1pmU3dPRFpkb2tGeElfSVB3cm0xd0VQOGpjSTZiQ1BHWm9ONnY2bFp1bURJaW5fRWk4emx0Q29jdnlUUEplRGg4Sm13UlZaRVFBckxIVERGUUZWUmczN2x5ODJNOFE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 06:40:46 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "595.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "5" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=&users=spez&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_add_note.json b/tests/integration/cassettes/TestSubredditNotes.test_add_note.json new file mode 100644 index 000000000..5750b910c --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_add_note.json @@ -0,0 +1,523 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-28T04:01:43", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=DINEe3wkjuCkP7rUmj; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRVE1sSUp4bkRxa210SnFKNkxLUDBKMEU1RENRQmwzZlRMMU9SVWZWb05UaF9sZ0o3TFN3Z1hEUTRTbW1EN3YyZnJRVmtKWVI5ekJBLTlfVU16UlJmcEpVQ1g5QXZHbWxtUjhQTDRGam4tck5sYVlYNU9DSV9jTDd3UVByNzlaMzIxeFY; session_tracker=bedleqjcbiaoqfrdpf.0.1648440101307.Z0FBQUFBQmlRVE1sRTczOWhlSlRWbG9kLTl2alZTUnRYZ3BPME9jRktabXFrWjAxbFltMjNyYjJUN3hxT3A3aDZnSW9BSHJGbVRlZjlvSnNGSk1PaTR4Q1JQVXlEOVQ2cmJfbTNOaHhMQXdCXzZJbzBpT245RnZ5MWRHUU1XdGRzbFp1dDFkS0kybTc" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t2\", \"data\": {\"is_employee\": false, \"has_visited_new_profile\": false, \"is_friend\": false, \"pref_no_profanity\": false, \"has_external_account\": false, \"pref_geopopular\": \"GLOBAL\", \"pref_show_trending\": false, \"subreddit\": {\"default_set\": true, \"user_is_contributor\": false, \"banner_img\": \"\", \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": true, \"community_icon\": null, \"show_media\": true, \"icon_color\": \"\", \"user_is_muted\": false, \"display_name\": \"u_Watchful1\", \"header_img\": null, \"title\": \"\", \"coins\": 0, \"previous_names\": [], \"over_18\": false, \"icon_size\": [256, 256], \"primary_color\": \"\", \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"description\": \"\", \"submit_link_label\": \"\", \"header_size\": null, \"restrict_commenting\": false, \"subscribers\": 152, \"submit_text_label\": \"\", \"is_default_icon\": false, \"link_flair_position\": \"\", \"display_name_prefixed\": \"u/Watchful1\", \"key_color\": \"\", \"name\": \"t5_1tpu9w\", \"is_default_banner\": true, \"url\": \"/user/Watchful1/\", \"quarantine\": false, \"banner_size\": null, \"user_is_moderator\": true, \"accept_followers\": true, \"public_description\": \"Runs u/RemindMeBot and u/UpdateMeBot, moderates r/CompetitiveOverwatch. Happy to answer any python/praw questions\", \"link_flair_enabled\": false, \"disable_contributor_requests\": false, \"subreddit_type\": \"user\", \"user_is_subscriber\": false}, \"pref_show_presence\": false, \"snoovatar_img\": \"\", \"snoovatar_size\": null, \"gold_expiration\": 1708295531, \"has_gold_subscription\": true, \"is_sponsor\": false, \"num_friends\": 0, \"features\": {\"mod_service_mute_writes\": true, \"promoted_trend_blanks\": true, \"show_amp_link\": true, \"top_content_email_digest_v2\": {\"owner\": \"growth\", \"variant\": \"control_1\", \"experiment_id\": 363}, \"chat\": true, \"is_email_permission_required\": false, \"mod_awards\": true, \"expensive_coins_package\": true, \"mweb_xpromo_revamp_v2\": {\"owner\": \"growth\", \"variant\": \"treatment_6\", \"experiment_id\": 457}, \"awards_on_streams\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_ios\": true, \"chat_subreddit\": true, \"cookie_consent_banner\": true, \"modlog_copyright_removal\": true, \"do_not_track\": true, \"mod_service_mute_reads\": true, \"chat_user_settings\": true, \"use_pref_account_deployment\": true, \"mweb_xpromo_interstitial_comments_ios\": true, \"noreferrer_to_noopener\": true, \"premium_subscriptions_table\": true, \"mweb_xpromo_interstitial_comments_android\": true, \"crowd_control_for_post\": true, \"chat_group_rollout\": true, \"resized_styles_images\": true, \"spez_modal\": true, \"mweb_xpromo_modal_listing_click_daily_dismissible_android\": true}, \"can_edit_name\": false, \"is_blocked\": false, \"verified\": true, \"new_modmail_exists\": false, \"pref_autoplay\": false, \"coins\": 35585, \"has_paypal_subscription\": false, \"has_subscribed_to_premium\": true, \"id\": \"d0z23\", \"can_create_subreddit\": true, \"over_18\": true, \"is_gold\": true, \"is_mod\": true, \"awarder_karma\": 3884, \"suspension_expiration_utc\": null, \"has_stripe_subscription\": true, \"is_suspended\": false, \"pref_video_autoplay\": false, \"in_chat\": true, \"has_android_subscription\": false, \"in_redesign_beta\": false, \"icon_img\": \"https://styles.redditmedia.com/t5_1tpu9w/styles/profileIcon_357tmiqf7mg41.png?width=256\\u0026height=256\\u0026crop=256:256,smart\\u0026s=60a212b73fd172150d3007b6d501228bdbc12b59\", \"has_mod_mail\": false, \"pref_nightmode\": false, \"awardee_karma\": 4013, \"hide_from_robots\": false, \"password_set\": true, \"modhash\": null, \"link_karma\": 50683, \"force_password_reset\": false, \"total_karma\": 264996, \"inbox_count\": 0, \"pref_top_karma_subreddits\": false, \"has_mail\": false, \"pref_show_snoovatar\": false, \"name\": \"Watchful1\", \"pref_clickgadget\": 5, \"created\": 1378424297.0, \"has_verified_email\": true, \"gold_creddits\": 0, \"created_utc\": 1378424297.0, \"has_ios_subscription\": false, \"pref_show_twitter\": false, \"in_beta\": false, \"comment_karma\": 206416, \"accept_followers\": true, \"has_subscribed\": true}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4040" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Mon, 28 Mar 2022 04:01:43 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRVE1sSUp4bkRxa210SnFKNkxLUDBKMEU1RENRQmwzZlRMMU9SVWZWb05UaF9sZ0o3TFN3Z1hEUTRTbW1EN3YyZnJRVmtKWVI5ekJBLTlfVU16UlJmcEpVQ1g5QXZHbWxtUjhQTDRGam4tck5sYVlYNU9DSV9jTDd3UVByNzlaMzIxeFY; Max-Age=63072000; Path=/; Domain=.reddit.com; SameSite=None; Secure", + "session_tracker=bedleqjcbiaoqfrdpf.0.1648440103023.Z0FBQUFBQmlRVE1uM0JsX2FEWEpnWmMtdE5JVjdDemF0cGJEN25mV3hQUEZ0Q21TOUFMTzhIT1VDNzJzR2l1UGk4ZXJ3QlhyVUJxcDlselhIMmVqa1lTRFd1Z2FEM1NyX2FyTzR0NkVJWWtxLXhHNGZUUmkxTFNLXzNMMHBSQmdhU01MY1BIZ3JpZWw; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 28-Mar-2022 06:01:43 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Thu, 27-Mar-2025 04:01:43 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "589.0" + ], + "x-ratelimit-reset": [ + "497" + ], + "x-ratelimit-used": [ + "11" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/user/Watchful1/about/?raw_json=1" + } + }, + { + "recorded_at": "2022-03-28T04:01:44", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=DINEe3wkjuCkP7rUmj; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRVE1sSUp4bkRxa210SnFKNkxLUDBKMEU1RENRQmwzZlRMMU9SVWZWb05UaF9sZ0o3TFN3Z1hEUTRTbW1EN3YyZnJRVmtKWVI5ekJBLTlfVU16UlJmcEpVQ1g5QXZHbWxtUjhQTDRGam4tck5sYVlYNU9DSV9jTDd3UVByNzlaMzIxeFY; redesign_optout=true; session_tracker=bedleqjcbiaoqfrdpf.0.1648440103023.Z0FBQUFBQmlRVE1uM0JsX2FEWEpnWmMtdE5JVjdDemF0cGJEN25mV3hQUEZ0Q21TOUFMTzhIT1VDNzJzR2l1UGk4ZXJ3QlhyVUJxcDlselhIMmVqa1lTRFd1Z2FEM1NyX2FyTzR0NkVJWWtxLXhHNGZUUmkxTFNLXzNMMHBSQmdhU01MY1BIZ3JpZWw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/r//about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t5\", \"data\": {\"user_flair_background_color\": null, \"submit_text_html\": null, \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": true, \"wiki_enabled\": true, \"user_is_muted\": false, \"user_can_flair_in_sr\": true, \"display_name\": \"\", \"header_img\": null, \"title\": \"Subreddit for testing bots\", \"allow_galleries\": false, \"icon_size\": null, \"primary_color\": \"\", \"active_user_count\": 5, \"icon_img\": \"\", \"display_name_prefixed\": \"r/\", \"accounts_active\": 5, \"public_traffic\": false, \"subscribers\": 13, \"user_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 123\"}], \"videostream_links_count\": 0, \"name\": \"t5_3fib0\", \"quarantine\": false, \"hide_ads\": false, \"prediction_leaderboard_entry_type\": \"IN_FEED\", \"emojis_enabled\": true, \"advertiser_category\": \"\", \"public_description\": \"\", \"comment_score_hide_mins\": 0, \"allow_predictions\": false, \"user_has_favorited\": false, \"user_flair_template_id\": \"bb18a014-3b06-11e9-bc95-0e63402c743c\", \"community_icon\": \"\", \"banner_background_image\": \"\", \"original_content_tag_enabled\": false, \"community_reviewed\": false, \"submit_text\": \"\", \"description_html\": null, \"spoilers_enabled\": true, \"allow_talks\": false, \"header_size\": null, \"user_flair_position\": \"left\", \"all_original_content\": false, \"collections_enabled\": true, \"is_enrolled_in_new_modmail\": true, \"key_color\": \"\", \"event_posts_enabled\": true, \"can_assign_user_flair\": true, \"created\": 1468810428.0, \"wls\": null, \"show_media_preview\": false, \"submission_type\": \"any\", \"user_is_subscriber\": true, \"disable_contributor_requests\": false, \"allow_videogifs\": true, \"should_archive_posts\": false, \"user_flair_type\": \"richtext\", \"allow_polls\": true, \"collapse_deleted_comments\": false, \"coins\": 0, \"emojis_custom_size\": null, \"public_description_html\": null, \"allow_videos\": true, \"is_crosspostable_subreddit\": true, \"notification_level\": \"low\", \"can_assign_link_flair\": true, \"has_menu_widget\": false, \"accounts_active_is_fuzzed\": false, \"allow_prediction_contributors\": false, \"submit_text_label\": \"\", \"link_flair_position\": \"right\", \"user_sr_flair_enabled\": true, \"user_flair_enabled_in_sr\": true, \"allow_chat_post_creation\": false, \"allow_discovery\": true, \"accept_followers\": true, \"user_sr_theme_enabled\": true, \"link_flair_enabled\": true, \"subreddit_type\": \"public\", \"suggested_comment_sort\": null, \"banner_img\": \"\", \"user_flair_text\": \"test 123\", \"banner_background_color\": \"\", \"show_media\": false, \"id\": \"3fib0\", \"user_is_moderator\": true, \"over18\": false, \"header_title\": \"\", \"description\": \"\", \"is_chat_post_feature_enabled\": true, \"submit_link_label\": \"\", \"user_flair_text_color\": \"dark\", \"restrict_commenting\": false, \"user_flair_css_class\": \"test 1123\", \"allow_images\": true, \"lang\": \"en\", \"whitelist_status\": null, \"url\": \"/r//\", \"created_utc\": 1468810428.0, \"banner_size\": null, \"mobile_banner_image\": \"\", \"user_is_contributor\": true, \"allow_predictions_tournament\": false}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "2928" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Mon, 28 Mar 2022 04:01:43 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bedleqjcbiaoqfrdpf.0.1648440103261.Z0FBQUFBQmlRVE1ubEp6YzJManlNYzV6OG9GNHd5ME9VV0ZDbnJNWC1DbC1hNF9YZnpwTldkeVNfLTlHZFRWMTFaVHVld0tDQ0I2UlNVRHBVdEZMeVFTMHA0NXRQWFU5SUtKWGd5S0NFRzMta012Tmt2ZjN2YzFkT0k2TnpzOThSanlMRkFkdWM2S2U; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 28-Mar-2022 06:01:43 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "588.0" + ], + "x-ratelimit-reset": [ + "497" + ], + "x-ratelimit-used": [ + "12" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/r//about/?raw_json=1" + } + }, + { + "recorded_at": "2022-03-28T04:01:44", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=DINEe3wkjuCkP7rUmj; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRVE1sSUp4bkRxa210SnFKNkxLUDBKMEU1RENRQmwzZlRMMU9SVWZWb05UaF9sZ0o3TFN3Z1hEUTRTbW1EN3YyZnJRVmtKWVI5ekJBLTlfVU16UlJmcEpVQ1g5QXZHbWxtUjhQTDRGam4tck5sYVlYNU9DSV9jTDd3UVByNzlaMzIxeFY; redesign_optout=true; session_tracker=bedleqjcbiaoqfrdpf.0.1648440103261.Z0FBQUFBQmlRVE1ubEp6YzJManlNYzV6OG9GNHd5ME9VV0ZDbnJNWC1DbC1hNF9YZnpwTldkeVNfLTlHZFRWMTFaVHVld0tDQ0I2UlNVRHBVdEZMeVFTMHA0NXRQWFU5SUtKWGd5S0NFRzMta012Tmt2ZjN2YzFkT0k2TnpzOThSanlMRkFkdWM2S2U" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/user/PyAPITestUser3/about/?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"kind\": \"t2\", \"data\": {\"is_employee\": false, \"is_friend\": false, \"subreddit\": {\"default_set\": true, \"user_is_contributor\": false, \"banner_img\": \"\", \"restrict_posting\": true, \"user_is_banned\": false, \"free_form_reports\": true, \"community_icon\": null, \"show_media\": true, \"icon_color\": \"#E4ABFF\", \"user_is_muted\": false, \"display_name\": \"u_PyAPITestUser3\", \"header_img\": null, \"title\": \"\", \"previous_names\": [], \"over_18\": false, \"icon_size\": [256, 256], \"primary_color\": \"\", \"icon_img\": \"https://www.redditstatic.com/avatars/defaults/v2/avatar_default_7.png\", \"description\": \"\", \"submit_link_label\": \"\", \"header_size\": null, \"restrict_commenting\": false, \"subscribers\": 0, \"submit_text_label\": \"\", \"is_default_icon\": true, \"link_flair_position\": \"\", \"display_name_prefixed\": \"u/PyAPITestUser3\", \"key_color\": \"\", \"name\": \"t5_b43nd\", \"is_default_banner\": true, \"url\": \"/user/PyAPITestUser3/\", \"quarantine\": false, \"banner_size\": null, \"user_is_moderator\": false, \"accept_followers\": true, \"public_description\": \"\", \"link_flair_enabled\": false, \"disable_contributor_requests\": false, \"subreddit_type\": \"user\", \"user_is_subscriber\": false}, \"snoovatar_size\": null, \"awardee_karma\": 0, \"id\": \"6c1xj\", \"verified\": true, \"is_gold\": false, \"is_mod\": false, \"awarder_karma\": 0, \"has_verified_email\": true, \"icon_img\": \"https://www.redditstatic.com/avatars/defaults/v2/avatar_default_7.png\", \"hide_from_robots\": false, \"link_karma\": 1, \"pref_show_snoovatar\": false, \"is_blocked\": false, \"total_karma\": 1, \"accept_chats\": false, \"name\": \"PyAPITestUser3\", \"created\": 1322552953.0, \"created_utc\": 1322552953.0, \"snoovatar_img\": \"\", \"comment_karma\": 0, \"accept_followers\": true, \"has_subscribed\": true, \"accept_pms\": true}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "1709" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Mon, 28 Mar 2022 04:01:43 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=bedleqjcbiaoqfrdpf.0.1648440103513.Z0FBQUFBQmlRVE1uU2Q3STBRTVhzdkJodmFwVVZSV2ZTNmpTMlBBTUo3UHZ0N3owOFd0S2t6V2k0aXRVaGtsOWpVQkg3ckVWd2RWX1dJRkVxcHpRZXZBVHBkaGJwU0VaS2RCbV9fbGZiNGJlU043bTM0bFg0T0tvRnpWbHdteE1CTjkzNnBnUmttODE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Mon, 28-Mar-2022 06:01:43 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "587.0" + ], + "x-ratelimit-reset": [ + "497" + ], + "x-ratelimit-used": [ + "13" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/user/PyAPITestUser3/about/?raw_json=1" + } + }, + { + "recorded_at": "2022-04-02T05:29:10", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:29:09 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=xK3Nz1PlIXS8gFJVHz; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "290" + ], + "x-ratelimit-reset": [ + "51" + ], + "x-ratelimit-used": [ + "10" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-02T05:29:10", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json&label=HELPFUL_USER¬e=test+note&reddit_id=t3_tpbemz&subreddit=&user=pyapitestuser3" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "109" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "edgebucket=xK3Nz1PlIXS8gFJVHz" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5dc1d5d4-ed2a-4408-8c70-5bd2c55a6ada\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648877350, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "459" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:29:10 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSOThtZFhnUkdyVDMybkhZWi1nMnJYb0o5eHlneDNWb3cwcVpRNHJXSzlUc2dGenR6WVl6VmlIVnlSMDAxaEJlQ2QwaVliaXJLMjFRcDdxQkd4RzJWclVGdHpNSzYwOS0yS1VLRkxuVkFEaFdvaWNVZG50MkpELWhmM2VBWG5Dd2VzSEU; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 05:29:10 GMT; secure", + "session_tracker=erdicielihmihdeknm.0.1648877350084.Z0FBQUFBQmlSOThtOVpacFZtVW5YeDlsdm9vREpCbkRjckh1ckNJd0F6VU5yYW1aamMzdzdYaVFmaXlaZU1nWG9ESVBpd1BrSVRncnZGNUVqVERuUkQ1bGtTYnh3aExhd2xWMzZ1TFBldHBqTUNlY2xsMmItTS10OTFnMUt5M2JJd1FLVTIyVk5ONmI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 07:29:10 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "560.0" + ], + "x-ratelimit-reset": [ + "50" + ], + "x-ratelimit-used": [ + "40" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_add_notes_for_submission.json b/tests/integration/cassettes/TestSubredditNotes.test_add_notes_for_submission.json new file mode 100644 index 000000000..b86089ec3 --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_add_notes_for_submission.json @@ -0,0 +1,314 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T06:04:02", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 06:04:02 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=mrN4MojFSdP085co4R; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "279" + ], + "x-ratelimit-reset": [ + "358" + ], + "x-ratelimit-used": [ + "21" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-03-30T06:04:03", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=mrN4MojFSdP085co4R" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": 1648351390, \"subreddit\": \"\", \"selftext\": \"test\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"test post by watchful12\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_tpbemz\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": \"bb18a014-3b06-11e9-bc95-0e63402c743c\", \"is_original_content\": false, \"author_fullname\": \"t2_j3r75\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": \"Watchful1\", \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": \"test 1123\", \"previous_visits\": [1648618668.0], \"author_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 123\"}], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"subreddit_type\": \"public\", \"created\": 1648351304.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"likes\": null, \"suggested_sort\": null, \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": \"test 123\", \"treatment_tags\": [], \"visited\": true, \"removed_by\": null, \"mod_note\": null, \"distinguished\": null, \"subreddit_id\": \"t5_3fib0\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"num_reports\": 0, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"tpbemz\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Watchful12\", \"discussion_type\": null, \"num_comments\": 0, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": true, \"author_flair_text_color\": \"dark\", \"permalink\": \"/r//comments/tpbemz/test_post_by_watchful12/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/tpbemz/test_post_by_watchful12/\", \"subreddit_subscribers\": 13, \"created_utc\": 1648351304.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "3214" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 06:04:03 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRX0xUbmxmNUMtSWY1WW9BekJEYW9pc0FLa25Dd2JzV2xUSTBrbkd6UUF0Vm54SXh0UGZ6eGtNLWprbTFvYWhFSEI5SUJhc3hZem43enBsTjFrSHJXeXdxdmJHbDlGWFZ4Zkl0WDJRUERBV3lVczY3eDVnNTNGY09zU1VHZnBrVnRUQUc; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 06:04:03 GMT; secure; SameSite=None; Secure", + "session_tracker=hlfbfiponehiiegacp.0.1648620243085.Z0FBQUFBQmlRX0xUeDVJXzlzM0hSM2Fnd3JTN2xWc00xQk9oSlp4ejltd0tnNDBvMHFuNWo1aG93ZFZYaHRFZ2dXNjhaeWFMWGpvOEptVGk5VU1ocU5ZOTJtUzVUTGJkR3g4d1c2LTJBTDJIYjdQQVlNMmFRNE4tbFNMMFoyTUh0SkljMXMyNDczcXk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 08:04:03 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Sat, 29-Mar-2025 06:04:03 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "584.0" + ], + "x-ratelimit-reset": [ + "357" + ], + "x-ratelimit-used": [ + "16" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T06:04:03", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json¬e=test+note&reddit_id=t3_tpbemz&subreddit=&user=Watchful12" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "86" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "csv=2; edgebucket=mrN4MojFSdP085co4R; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRX0xUbmxmNUMtSWY1WW9BekJEYW9pc0FLa25Dd2JzV2xUSTBrbkd6UUF0Vm54SXh0UGZ6eGtNLWprbTFvYWhFSEI5SUJhc3hZem43enBsTjFrSHJXeXdxdmJHbDlGWFZ4Zkl0WDJRUERBV3lVczY3eDVnNTNGY09zU1VHZnBrVnRUQUc; redesign_optout=true; session_tracker=hlfbfiponehiiegacp.0.1648620243085.Z0FBQUFBQmlRX0xUeDVJXzlzM0hSM2Fnd3JTN2xWc00xQk9oSlp4ejltd0tnNDBvMHFuNWo1aG93ZFZYaHRFZ2dXNjhaeWFMWGpvOEptVGk5VU1ocU5ZOTJtUzVUTGJkR3g4d1c2LTJBTDJIYjdQQVlNMmFRNE4tbFNMMFoyTUh0SkljMXMyNDczcXk" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_f88e2a6c-3776-42c4-976b-7062ab1fba03\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648620243, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "445" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 06:04:03 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=hlfbfiponehiiegacp.0.1648620243263.Z0FBQUFBQmlRX0xUcW1ub3lMdDRNTVdodnNZdVNHcWQ4WFZCbE1jSV9TUUFoaHFwc0ZQeC1sQzc3OEZYREFheTltN1RHTFppT1QwM01Vc3JTdFZWYnZOUElMTFJGUFZHVGg2djNCbmlhTzNwcWxWLVFoUF9PaW5xX3NxMUxXMkZUT3Q4UWF4dHRlS00; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 08:04:03 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "583.0" + ], + "x-ratelimit-reset": [ + "357" + ], + "x-ratelimit-used": [ + "17" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_delete_notes.json b/tests/integration/cassettes/TestSubredditNotes.test_delete_notes.json new file mode 100644 index 000000000..35856cc7e --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_delete_notes.json @@ -0,0 +1,412 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "290" + ], + "x-ratelimit-reset": [ + "495" + ], + "x-ratelimit-used": [ + "10" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "api_type=json¬e=test+note&subreddit=SubTestBot1&user=pyapitestuser3" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"created\": {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617705, \"type\": \"NOTE\"}}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "435" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:21:45 GMT; secure", + "session_tracker=gooqloajgdmqkgicon.0.1648617705895.Z0FBQUFBQmlRLWpwNDUzNVJ4cXQwMy0xelFpa21JUVdZcHpEMHJaNmlwMzBNdG9HMFh6OWVZaDFnWFhoMkFhZURwTl9obmFSb2otd1RNOW9xYkJ0eFNQY2VUazZJQ0hBZVotZ25KWG8tbXgxQ3hhNTFtWjJLNy02ZDZ1M3JiMW1GZU83UGYzdHhfV0Q; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:45 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "587.0" + ], + "x-ratelimit-reset": [ + "495" + ], + "x-ratelimit-used": [ + "13" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:21:45", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; session_tracker=gooqloajgdmqkgicon.0.1648617705895.Z0FBQUFBQmlRLWpwNDUzNVJ4cXQwMy0xelFpa21JUVdZcHpEMHJaNmlwMzBNdG9HMFh6OWVZaDFnWFhoMkFhZURwTl9obmFSb2otd1RNOW9xYkJ0eFNQY2VUazZJQ0hBZVotZ25KWG8tbXgxQ3hhNTFtWjJLNy02ZDZ1M3JiMW1GZU83UGYzdHhfV0Q" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "DELETE", + "uri": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=SubTestBot1¬e_id=ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"deleted\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "17" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "set-cookie": [ + "session_tracker=gooqloajgdmqkgicon.0.1648617706031.Z0FBQUFBQmlRLWpxM3VXbGZXVWVvX1F6RVZHak4yV0Uwd0pOMFFhMGFnTW5wVHFIMlNoSkczLUZ4Wmdqb01HVkwxZ094ZGpsMjI2b2kwQ0wzWW5uNU90MTVPalZ5S2YzTEp2TXFrTnl1b0w3NDBjSVZBaGVEbkNkaEo0R3UzNGlSdU9iVGdjWldJdms; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:46 GMT; secure" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "586.0" + ], + "x-ratelimit-reset": [ + "494" + ], + "x-ratelimit-used": [ + "14" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?user=PyAPITestUser3&subreddit=SubTestBot1¬e_id=ModNote_3adc985d-cdbc-4fac-9ef0-7f8a79f31b53&raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:21:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=KtAqKbvCRNvKb1F1q2; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; session_tracker=gooqloajgdmqkgicon.0.1648617706031.Z0FBQUFBQmlRLWpxM3VXbGZXVWVvX1F6RVZHak4yV0Uwd0pOMFFhMGFnTW5wVHFIMlNoSkczLUZ4Wmdqb01HVkwxZ094ZGpsMjI2b2kwQ0wzWW5uNU90MTVPalZ5S2YzTEp2TXFrTnl1b0w3NDBjSVZBaGVEbkNkaEo0R3UzNGlSdU9iVGdjWldJdms" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=SubTestBot1&user=pyapitestuser3&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_61c08792-a55a-4d34-87f0-075bbca01f3e\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617670, \"cursor\": \"MTY0ODYxNzY3MDYyNA==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_527a60dc-f7f6-4acb-b4c0-653c426230cb\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648617638, \"cursor\": \"MTY0ODYxNzYzODczOQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_486a277b-c35e-48a7-b473-f37e38621257\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441115, \"cursor\": \"MTY0ODQ0MTExNTM5Nw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_c085c0aa-1145-4e6b-9d74-07322bd77947\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441055, \"cursor\": \"MTY0ODQ0MTA1NTg0MA==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_fd62e7af-a06b-4701-8259-e554859b3c1c\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648441021, \"cursor\": \"MTY0ODQ0MTAyMTU3Mw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_19a53dcf-4281-4887-84d2-eb0890cccec0\", \"user_note_data\": {\"note\": \"test note 3\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648440101, \"cursor\": \"MTY0ODQ0MDEwMTMyMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_346e1bf5-8c73-4b4b-b952-e56b1d583ada\", \"user_note_data\": {\"note\": \"test note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648440085, \"cursor\": \"MTY0ODQ0MDA4NTAwNQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5e6920c8-faae-4751-82b0-59a536f6130d\", \"user_note_data\": {\"note\": \"test note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439497, \"cursor\": \"MTY0ODQzOTQ5NzEwMg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_1fe5cdfa-45cf-4c34-b613-35b6044071f6\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439326, \"cursor\": \"MTY0ODQzOTMyNjcxMw==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_dc37a60d-4fc1-4a46-8d95-debbc014be46\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648439157, \"cursor\": \"MTY0ODQzOTE1NzkyMw==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY0ODYxNzY3MDYyNA==\", \"end_cursor\": \"MTY0ODQzOTE1NzkyMw==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4727" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:21:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLWpwSk8xUWFHLWswZVpnaVZiU3BsYW5jS0RxaEQ5OFVUejZhLUdydTF2NnBzVmpMejFGaVVOcE9DRFVmVS1NZXpoS2FzLUU3Nmd0SkZqTWFfQTJkeVM3dEtKb05ORmZvY1g0dHE4MWpnX3c1Q1dqcUFacWRqdDJGNVdhSDBNbjFPN1A; Max-Age=63072000; Path=/; Domain=.reddit.com; SameSite=None; Secure", + "session_tracker=gooqloajgdmqkgicon.0.1648617706198.Z0FBQUFBQmlRLWpxaHRfeUZYWDlrSmZ3Y0N6RlRoeGdMZ1VJcmtQUEpieVJ6V1lIVmJPc195dE5SUy1Ma0RaVmdJTHlqakJPanJWSUoyZXllRzRlXy00MUppS09NSG1IT0owRXJCSTFGTlhSZkgteTJORHEyRUhfQU5yb0ZkQXM4dVNHMFFVak80ZXc; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:21:46 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "494" + ], + "x-ratelimit-used": [ + "15" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=SubTestBot1&user=pyapitestuser3&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_get_bulk_notes.json b/tests/integration/cassettes/TestSubredditNotes.test_get_bulk_notes.json new file mode 100644 index 000000000..af55bac50 --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_get_bulk_notes.json @@ -0,0 +1,407 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:43:14", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=8CVxVn4dfIIIjoptdC" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot1%2Csubtestbot1&users=Watchful1%2Cwatchful12%2Cspez&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"subtestbot1\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"subtestbot1\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2af06395-cf36-4cdc-82fc-a19694e01234\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648618694, \"type\": \"NOTE\"}, null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "876" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:43:14 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTN5Y2pVU0VqWVRtc3ZzaVBMWC1MVy0xcjFSRGttcGE2ZkxEMUNfMi1HLWpVWkpXaGJJQW1MbzBhOTdESVA4MllWOVRLamJIUGFITjlqRVlpT05lcURXdWd3T2JtMGtxUWg4S09BNjNfTG5VOTJ3enA0VmFjTmp1X182SnRsUTl6b0Y; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:43:14 GMT; secure; SameSite=None; Secure", + "session_tracker=jkdhmrgremkhlgpjgr.0.1648618994516.Z0FBQUFBQmlRLTN5VVFSYVExMXZmTVA2ZU9TUXFmTGhVUENsQllIQVMxdlJEc0I4S19tNTB2Yk5mYmNzc2JKTVNnVkhRZ0xpVXNsSkZtLTFLcGUyY2k5SnhoSVduTlByOFF5NHlQTFdoY1hnT0hnQmFvRUZ6b0o0UzQ0UnNwVFo2cUpPLXU1UVdOUEI; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:43:14 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "585.0" + ], + "x-ratelimit-reset": [ + "406" + ], + "x-ratelimit-used": [ + "15" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot1%2Csubtestbot1&users=Watchful1%2Cwatchful12%2Cspez&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:45 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=4PZwoKMhJTJ3ewxksp; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "299" + ], + "x-ratelimit-reset": [ + "555" + ], + "x-ratelimit-used": [ + "1" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=4PZwoKMhJTJ3ewxksp" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot1&users=Watchful1%2Cwatchful12&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"subtestbot1\", \"user\": \"Watchful1\", \"operator\": \"Watchful1\", \"id\": \"ModNote_853f9951-2f4f-4a7f-80ff-aa6aeb2c7a1e\", \"user_note_data\": {\"note\": \"praw_note 2\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_d0z23\", \"created_at\": 1648167599, \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"subtestbot1\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_f88e2a6c-3776-42c4-976b-7062ab1fba03\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648620243, \"type\": \"NOTE\"}]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "870" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU1ZPUjFIWkFXWGpWWlM2bDNCYWVRcUFKWlhwRWpYUDh1eTN1OFRfT2V2c2xILUptUXhMSHU5b3dxdGhVMlNLcFVoTVBSN0xUTmh2ZFRxQ1h6dXYxWFdUSEd1dHdWTDVzTGx6MVpqb0VmTk5ZOE0zMWpKT1N2VzUzeC1jTmNqMUpDN3g; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Tue, 02-Apr-2024 04:40:46 GMT; secure; SameSite=None; Secure", + "session_tracker=hropqbnfdhgdallkpd.0.1648960846000.Z0FBQUFBQmlTU1ZPUWtkWDBrQi12Wm94T084RkpycUJlRzluUEhZTFZBUXhfN0wxNUdNMVRuUFFqY3V4elQwRHFSTXBEa21jbVY1V3Y3TjhHMl85amtVNEI3alFOUzJnbGF4a29rYUc0QzM1REwtOXhiU2VER1lnWUlUNkt5bVlQamJ0MnhwaXNBaWw; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 06:40:46 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "596.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "4" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1%2Csubtestbot1&users=Watchful1%2Cwatchful12&raw_json=1" + } + }, + { + "recorded_at": "2022-04-03T04:40:46", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=4PZwoKMhJTJ3ewxksp; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlTU1ZPUjFIWkFXWGpWWlM2bDNCYWVRcUFKWlhwRWpYUDh1eTN1OFRfT2V2c2xILUptUXhMSHU5b3dxdGhVMlNLcFVoTVBSN0xUTmh2ZFRxQ1h6dXYxWFdUSEd1dHdWTDVzTGx6MVpqb0VmTk5ZOE0zMWpKT1N2VzUzeC1jTmNqMUpDN3g; session_tracker=hropqbnfdhgdallkpd.0.1648960846000.Z0FBQUFBQmlTU1ZPUWtkWDBrQi12Wm94T084RkpycUJlRzluUEhZTFZBUXhfN0wxNUdNMVRuUFFqY3V4elQwRHFSTXBEa21jbVY1V3Y3TjhHMl85amtVNEI3alFOUzJnbGF4a29rYUc0QzM1REwtOXhiU2VER1lnWUlUNkt5bVlQamJ0MnhwaXNBaWw" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1&users=spez&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [null]}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "21" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sun, 03 Apr 2022 04:40:46 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=hropqbnfdhgdallkpd.0.1648960846131.Z0FBQUFBQmlTU1ZPVGdHWmZ3dVZlVTk2MlNSUVVTdTdSblJMVkJueFFsSEdEV1pmU3dPRFpkb2tGeElfSVB3cm0xd0VQOGpjSTZiQ1BHWm9ONnY2bFp1bURJaW5fRWk4emx0Q29jdnlUUEplRGg4Sm13UlZaRVFBckxIVERGUUZWUmczN2x5ODJNOFE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sun, 03-Apr-2022 06:40:46 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "595.0" + ], + "x-ratelimit-reset": [ + "554" + ], + "x-ratelimit-used": [ + "5" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes/recent?subreddits=subtestbot1&users=spez&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_get_notes.json b/tests/integration/cassettes/TestSubredditNotes.test_get_notes.json new file mode 100644 index 000000000..96cf1e06a --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_get_notes.json @@ -0,0 +1,206 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-04-02T05:35:14", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:35:13 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=WI8Vrc4y2lK3gte6ZP; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "262" + ], + "x-ratelimit-reset": [ + "287" + ], + "x-ratelimit-used": [ + "38" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-04-02T05:35:14", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=WI8Vrc4y2lK3gte6ZP" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=SubTestBot1&user=pyapitestuser3&limit=2&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5dc1d5d4-ed2a-4408-8c70-5bd2c55a6ada\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648877350, \"cursor\": \"MTY0ODg3NzM1MDA5NA==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"SubTestBot1\", \"user\": \"PyAPITestUser3\", \"operator\": \"Watchful1\", \"id\": \"ModNote_8fc9acbd-cbd2-4bbe-a67f-6ed23caaf1dd\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"HELPFUL_USER\"}, \"user_id\": \"t2_6c1xj\", \"created_at\": 1648877345, \"cursor\": \"MTY0ODg3NzM0NTMxMw==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY0ODg3NzM1MDA5NA==\", \"end_cursor\": \"MTY0ODg3NzM0NTMxMw==\", \"has_next_page\": true}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "1080" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Sat, 02 Apr 2022 05:35:13 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlSLUNSSHRXOHU1UnUzMHNkVUxabUh1cU5JSHNRbmNVYWx2LVpyc3cxZlBiLUlEZEtYcGVDWGpFdVJQdXRTemR2Z0loMnJ6MkdweUp6VElJNUYwQ240X182akQybjJsTVFKczE1MGRtZzdCV0tyMkRrNzduQjNfTVQ0UXA0ZVNvaVNCTGE; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Mon, 01-Apr-2024 05:35:13 GMT; secure; SameSite=None; Secure", + "session_tracker=aaadbfbbnjrrobqcjc.0.1648877713743.Z0FBQUFBQmlSLUNSa0RYNEl5T1lvYmVXdHNoUDN1azFFQVhzZ2VuaXJoOEdUNklyNTJwSGExaVpDV3JzdldvZDhpcjZRTXhFZXktSkZDUE5VNW5vVGV1dnhvTkJ1UDhqcS1McVBSM2FoaWdkZXJ2bVhUZEpnV2tlSHhrN0R2MnQyX2xLSjYzNFZxQjk; Domain=reddit.com; Max-Age=7199; Path=/; expires=Sat, 02-Apr-2022 07:35:13 GMT; secure; SameSite=None; Secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "577.0" + ], + "x-ratelimit-reset": [ + "287" + ], + "x-ratelimit-used": [ + "23" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=SubTestBot1&user=pyapitestuser3&limit=2&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/cassettes/TestSubredditNotes.test_get_notes_for_submission.json b/tests/integration/cassettes/TestSubredditNotes.test_get_notes_for_submission.json new file mode 100644 index 000000000..c698889aa --- /dev/null +++ b/tests/integration/cassettes/TestSubredditNotes.test_get_notes_for_submission.json @@ -0,0 +1,311 @@ +{ + "http_interactions": [ + { + "recorded_at": "2022-03-30T05:39:17", + "request": { + "body": { + "encoding": "utf-8", + "string": "grant_type=refresh_token&refresh_token=" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "Basic " + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "75" + ], + "Content-Type": [ + "application/x-www-form-urlencoded" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "POST", + "uri": "https://www.reddit.com/api/v1/access_token" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"access_token\": \"\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"\", \"scope\": \"*\"}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "close" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "edgebucket=IGp0heqROQqKMMU14I; Domain=reddit.com; Max-Age=63071999; Path=/; secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "max-age=0, must-revalidate" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "284" + ], + "x-ratelimit-reset": [ + "43" + ], + "x-ratelimit-used": [ + "16" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://www.reddit.com/api/v1/access_token" + } + }, + { + "recorded_at": "2022-03-30T05:39:18", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "edgebucket=IGp0heqROQqKMMU14I" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "[{\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": 1, \"modhash\": null, \"geo_filter\": \"\", \"children\": [{\"kind\": \"t3\", \"data\": {\"author_flair_background_color\": null, \"approved_at_utc\": 1648351390, \"subreddit\": \"\", \"selftext\": \"test\", \"user_reports\": [], \"saved\": false, \"mod_reason_title\": null, \"gilded\": 0, \"clicked\": false, \"title\": \"test post by watchful12\", \"link_flair_richtext\": [], \"subreddit_name_prefixed\": \"r/\", \"hidden\": false, \"pwls\": null, \"link_flair_css_class\": null, \"downs\": 0, \"thumbnail_height\": null, \"top_awarded_type\": null, \"parent_whitelist_status\": null, \"hide_score\": false, \"name\": \"t3_tpbemz\", \"quarantine\": false, \"link_flair_text_color\": \"dark\", \"upvote_ratio\": 1.0, \"ignore_reports\": false, \"subreddit_type\": \"public\", \"ups\": 1, \"domain\": \"self.\", \"media_embed\": {}, \"thumbnail_width\": null, \"author_flair_template_id\": \"bb18a014-3b06-11e9-bc95-0e63402c743c\", \"is_original_content\": false, \"author_fullname\": \"t2_j3r75\", \"secure_media\": null, \"is_reddit_media_domain\": false, \"is_meta\": false, \"category\": null, \"secure_media_embed\": {}, \"link_flair_text\": null, \"can_mod_post\": true, \"score\": 1, \"approved_by\": \"Watchful1\", \"is_created_from_ads_ui\": false, \"author_premium\": false, \"thumbnail\": \"self\", \"edited\": false, \"author_flair_css_class\": \"test 1123\", \"author_flair_richtext\": [{\"e\": \"text\", \"t\": \"test 123\"}], \"gildings\": {}, \"content_categories\": null, \"is_self\": true, \"mod_note\": null, \"created\": 1648351304.0, \"link_flair_type\": \"text\", \"wls\": null, \"removed_by_category\": null, \"banned_by\": null, \"author_flair_type\": \"richtext\", \"total_awards_received\": 0, \"allow_live_comments\": false, \"selftext_html\": \"\\u003C!-- SC_OFF --\\u003E\\u003Cdiv class=\\\"md\\\"\\u003E\\u003Cp\\u003Etest\\u003C/p\\u003E\\n\\u003C/div\\u003E\\u003C!-- SC_ON --\\u003E\", \"likes\": null, \"suggested_sort\": null, \"banned_at_utc\": null, \"view_count\": null, \"archived\": false, \"no_follow\": true, \"spam\": false, \"is_crosspostable\": true, \"pinned\": false, \"over_18\": false, \"all_awardings\": [], \"awarders\": [], \"media_only\": false, \"can_gild\": true, \"removed\": false, \"spoiler\": false, \"locked\": false, \"author_flair_text\": \"test 123\", \"treatment_tags\": [], \"visited\": true, \"removed_by\": null, \"num_reports\": 0, \"distinguished\": null, \"subreddit_id\": \"t5_3fib0\", \"author_is_blocked\": false, \"mod_reason_by\": null, \"removal_reason\": null, \"link_flair_background_color\": \"\", \"id\": \"tpbemz\", \"is_robot_indexable\": true, \"num_duplicates\": 0, \"report_reasons\": [], \"author\": \"Watchful12\", \"discussion_type\": null, \"num_comments\": 0, \"send_replies\": true, \"media\": null, \"contest_mode\": false, \"author_patreon_flair\": false, \"approved\": true, \"author_flair_text_color\": \"dark\", \"permalink\": \"/r//comments/tpbemz/test_post_by_watchful12/\", \"whitelist_status\": null, \"stickied\": false, \"url\": \"https://www.reddit.com/r//comments/tpbemz/test_post_by_watchful12/\", \"subreddit_subscribers\": 13, \"created_utc\": 1648351304.0, \"num_crossposts\": 0, \"mod_reports\": [], \"is_video\": false}}], \"before\": null}}, {\"kind\": \"Listing\", \"data\": {\"after\": null, \"dist\": null, \"modhash\": null, \"geo_filter\": \"\", \"children\": [], \"before\": null}}]" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "3179" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTBHNjNnZnN2NHZ1b242U1N2Q1lDSHdac3p5SlFjaHJsLVpkNHJQZEdkbmxfRWlJRFZCSmJiOHZMVHRYUnBIaDRxQzVLNUlqZGF5a0ptWlRfT1lzblZOaWkxYTVGaFR2WmVUU2MtRldEemd0UHRrRTBrbXB5a2laMjRoTFBWREFDWjc; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Fri, 29-Mar-2024 05:39:18 GMT; secure; SameSite=None; Secure", + "session_tracker=qhkcclkinnlcpnrjoq.0.1648618758183.Z0FBQUFBQmlRLTBHTkNzUnlLc1Q2NVB4ZUh6Wmd0Tl9uUk54VXktRi0zTWNUanU5eUlCT0VKZ3E1YUxoUE1tQ0xXSVp2M2IzM1VmdU1BQmNDOGEzU3hHdEtsbENpYXNiLXBaRzZOaWRIM0ptTzRzQ3ZiNHBhSmotU1liVUQtRFZOMW1NY0pveWN1ek0; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:39:18 GMT; secure; SameSite=None; Secure", + "redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Sat, 29-Mar-2025 05:39:18 GMT; secure", + "csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "557.0" + ], + "x-ratelimit-reset": [ + "42" + ], + "x-ratelimit-used": [ + "43" + ], + "x-ua-compatible": [ + "IE=edge" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/comments/tpbemz/?limit=2048&sort=confidence&raw_json=1" + } + }, + { + "recorded_at": "2022-03-30T05:39:18", + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "Accept": [ + "*/*" + ], + "Accept-Encoding": [ + "identity" + ], + "Authorization": [ + "bearer " + ], + "Connection": [ + "keep-alive" + ], + "Cookie": [ + "csv=2; edgebucket=IGp0heqROQqKMMU14I; loid=0000000000000d0z23.2.1378424297146.Z0FBQUFBQmlRLTBHNjNnZnN2NHZ1b242U1N2Q1lDSHdac3p5SlFjaHJsLVpkNHJQZEdkbmxfRWlJRFZCSmJiOHZMVHRYUnBIaDRxQzVLNUlqZGF5a0ptWlRfT1lzblZOaWkxYTVGaFR2WmVUU2MtRldEemd0UHRrRTBrbXB5a2laMjRoTFBWREFDWjc; redesign_optout=true; session_tracker=qhkcclkinnlcpnrjoq.0.1648618758183.Z0FBQUFBQmlRLTBHTkNzUnlLc1Q2NVB4ZUh6Wmd0Tl9uUk54VXktRi0zTWNUanU5eUlCT0VKZ3E1YUxoUE1tQ0xXSVp2M2IzM1VmdU1BQmNDOGEzU3hHdEtsbENpYXNiLXBaRzZOaWRIM0ptTzRzQ3ZiNHBhSmotU1liVUQtRFZOMW1NY0pveWN1ek0" + ], + "User-Agent": [ + " PRAW/7.5.1.dev0 prawcore/2.3.0" + ] + }, + "method": "GET", + "uri": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Watchful12&limit=100&raw_json=1" + }, + "response": { + "body": { + "encoding": "UTF-8", + "string": "{\"mod_notes\": [{\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2af06395-cf36-4cdc-82fc-a19694e01234\", \"user_note_data\": {\"note\": \"test note\", \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648618694, \"cursor\": \"MTY0ODYxODY5NDI3NQ==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"unmuteuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_7ec157a2-ad7d-11ec-9b93-9989b85cc752\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351505, \"cursor\": \"MTY0ODM1MTUwNTA3Ng==\", \"type\": \"MUTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"unbanuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": \"was temporary\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_7be39fe4-ad7d-11ec-bb7c-63eb743d0b31\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351500, \"cursor\": \"MTY0ODM1MTUwMDI2Nw==\", \"type\": \"BAN\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"muteuser\", \"reddit_id\": \"t2_j3r75\", \"details\": null, \"description\": \"test\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_5a5fea5e-ad7d-11ec-87a5-fb058d9ef580\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351444, \"cursor\": \"MTY0ODM1MTQ0NDAzOQ==\", \"type\": \"MUTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"banuser\", \"reddit_id\": \"t2_j3r75\", \"details\": \"permanent\", \"description\": \"other: test ban\"}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_53e939f4-ad7d-11ec-9e1b-45fc86e2d94b\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t2_j3r75\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351433, \"cursor\": \"MTY0ODM1MTQzMzE5NQ==\", \"type\": \"BAN\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"approvelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"unspam\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_3a48541c-ad7d-11ec-953d-45e115bb1f3b\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351390, \"cursor\": \"MTY0ODM1MTM5MDE5Nw==\", \"type\": \"APPROVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"removelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"remove\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_35f07d8a-ad7d-11ec-a7a2-2130535e7279\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351382, \"cursor\": \"MTY0ODM1MTM4MjkxMQ==\", \"type\": \"REMOVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": \"approvelink\", \"reddit_id\": \"t3_tpbemz\", \"details\": \"confirm_ham\", \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_2d4ee328-ad7d-11ec-9917-c909a9f60748\", \"user_note_data\": {\"note\": null, \"reddit_id\": \"t3_tpbemz\", \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351368, \"cursor\": \"MTY0ODM1MTM2ODQzMA==\", \"type\": \"APPROVAL\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": null, \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_60c142bb-d0b8-4549-a97f-d78fd7d25675\", \"user_note_data\": {\"note\": \"second note with no label, no post\", \"reddit_id\": null, \"label\": null}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351353, \"cursor\": \"MTY0ODM1MTM1MzIwNg==\", \"type\": \"NOTE\"}, {\"subreddit_id\": \"t5_3fib0\", \"operator_id\": \"t2_d0z23\", \"mod_action_data\": {\"action\": null, \"reddit_id\": \"t3_tpbemz\", \"details\": null, \"description\": null}, \"subreddit\": \"\", \"user\": \"Watchful12\", \"operator\": \"Watchful1\", \"id\": \"ModNote_fa289d6b-c62e-42aa-9f58-177fb61ab166\", \"user_note_data\": {\"note\": \"initial note with label on post\", \"reddit_id\": \"t3_tpbemz\", \"label\": \"ABUSE_WARNING\"}, \"user_id\": \"t2_j3r75\", \"created_at\": 1648351336, \"cursor\": \"MTY0ODM1MTMzNjk1NQ==\", \"type\": \"NOTE\"}], \"start_cursor\": \"MTY0ODYxODY5NDI3NQ==\", \"end_cursor\": \"MTY0ODM1MTMzNjk1NQ==\", \"has_next_page\": false}" + }, + "headers": { + "Accept-Ranges": [ + "bytes" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "4895" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Date": [ + "Wed, 30 Mar 2022 05:39:18 GMT" + ], + "Server": [ + "snooserv" + ], + "Set-Cookie": [ + "session_tracker=qhkcclkinnlcpnrjoq.0.1648618758380.Z0FBQUFBQmlRLTBHaEZVWWVJZXFsZVo2NktsTm1TQnl1czdfTjBHSDlHWlc0bXhvRUNTbjg0ZU1STFlTZHhTS0NvWlF5MjgxNWJ0SWtvV3hidkZoelE5RUNYODJCV2JUMXJBN2ZQLUJSaUNQRTB3LTdRSTZNTGdFOVgzYzRoX3FiV2cyaDljMnZtU0o; Domain=reddit.com; Max-Age=7199; Path=/; expires=Wed, 30-Mar-2022 07:39:18 GMT; secure; SameSite=None; Secure" + ], + "Strict-Transport-Security": [ + "max-age=15552000; includeSubDomains; preload" + ], + "Vary": [ + "accept-encoding" + ], + "Via": [ + "1.1 varnish" + ], + "X-Moose": [ + "majestic" + ], + "cache-control": [ + "private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate" + ], + "expires": [ + "-1" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-ratelimit-remaining": [ + "556.0" + ], + "x-ratelimit-reset": [ + "42" + ], + "x-ratelimit-used": [ + "44" + ], + "x-xss-protection": [ + "1; mode=block" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://oauth.reddit.com/api/mod/notes?subreddit=&user=Watchful12&limit=100&raw_json=1" + } + } + ], + "recorded_with": "betamax/0.8.1" +} diff --git a/tests/integration/models/reddit/test_comment.py b/tests/integration/models/reddit/test_comment.py index 8facd36f4..09635f8dd 100644 --- a/tests/integration/models/reddit/test_comment.py +++ b/tests/integration/models/reddit/test_comment.py @@ -122,6 +122,15 @@ def test_mark_unread(self, _): comment = next(self.reddit.inbox.comment_replies()) comment.mark_unread() + def test_notes(self): + self.reddit.read_only = False + with self.use_cassette(): + comment = self.reddit.comment("i6yklz7") + note = comment.mod.create_note(label="HELPFUL_USER", note="test note") + notes = list(comment.mod.author_notes()) + assert note in notes + assert notes[notes.index(note)].user == comment.author + def test_parent__comment(self): comment = Comment(self.reddit, "cklhv0f") with self.use_cassette(): diff --git a/tests/integration/models/reddit/test_redditor.py b/tests/integration/models/reddit/test_redditor.py index 327374e83..b02448352 100644 --- a/tests/integration/models/reddit/test_redditor.py +++ b/tests/integration/models/reddit/test_redditor.py @@ -136,6 +136,15 @@ def test_unfriend(self, _): redditor = self.reddit.user.friends()[0] assert redditor.unfriend() is None + def test_notes__subreddits(self): + self.reddit.read_only = False + with self.use_cassette(): + redditor = self.reddit.redditor("Watchful1") + notes = list(redditor.notes.subreddits("subtestbot1", "subtestbot2")) + assert len(notes) == 2 + assert notes[0].user == redditor + assert notes[1] is None + class TestRedditorListings(IntegrationTest): def test_comments__controversial(self): diff --git a/tests/integration/models/reddit/test_submission.py b/tests/integration/models/reddit/test_submission.py index e16cf035c..46b132c76 100644 --- a/tests/integration/models/reddit/test_submission.py +++ b/tests/integration/models/reddit/test_submission.py @@ -388,6 +388,15 @@ def test_ignore_reports(self): with self.use_cassette(): self.reddit.submission("31ybt2").mod.ignore_reports() + def test_notes(self): + self.reddit.read_only = False + with self.use_cassette(): + submission = self.reddit.submission("uflrmv") + note = submission.mod.create_note(label="HELPFUL_USER", note="test note") + notes = list(submission.mod.author_notes()) + assert note in notes + assert notes[notes.index(note)].user == submission.author + def test_nsfw(self): self.reddit.read_only = False with self.use_cassette(): diff --git a/tests/integration/models/reddit/test_subreddit.py b/tests/integration/models/reddit/test_subreddit.py index 843a33f33..6388e2c74 100644 --- a/tests/integration/models/reddit/test_subreddit.py +++ b/tests/integration/models/reddit/test_subreddit.py @@ -1454,6 +1454,18 @@ def test_modqueue__only_submissions(self): count += 1 assert count > 0 + def test_notes(self): + self.reddit.read_only = False + with self.use_cassette(): + subreddit = self.reddit.subreddit(pytest.placeholders.test_subreddit) + notes = list( + subreddit.mod.notes.redditors("Watchful1", "watchful12", "spez") + ) + assert len(notes) == 3 + assert notes[0].user.name.lower() == "watchful1" + assert notes[1].user.name.lower() == "watchful12" + assert notes[2] is None + def test_reports(self): self.reddit.read_only = False with self.use_cassette(): diff --git a/tests/integration/models/test_mod_notes.py b/tests/integration/models/test_mod_notes.py new file mode 100644 index 000000000..ee72a9f02 --- /dev/null +++ b/tests/integration/models/test_mod_notes.py @@ -0,0 +1,70 @@ +from unittest import mock + +import pytest + +from .. import IntegrationTest + + +class TestModNotes(IntegrationTest): + REDDITOR = "pyapitestuser3" + + def test_create_note__submission(self): + self.reddit.read_only = False + with self.use_cassette(): + submission = self.reddit.submission("uflrmv") + result_note = submission.mod.create_note( + label="HELPFUL_USER", note="test note" + ) + assert result_note.user == submission.author + assert result_note.note == "test note" + assert result_note.label == "HELPFUL_USER" + + def test_create_note__thing_fullname(self): + self.reddit.read_only = False + with self.use_cassette(): + submission = self.reddit.submission("uflrmv") + result_note = self.reddit.notes.create( + label="HELPFUL_USER", note="test note", thing=submission.fullname + ) + assert result_note.user == submission.author + assert result_note.id.startswith("ModNote") + assert result_note.moderator.name == pytest.placeholders.username + assert result_note.note == "test note" + assert result_note.label == "HELPFUL_USER" + assert result_note.reddit_id == submission.fullname + + def test_create_note__thing_submission(self): + self.reddit.read_only = False + with self.use_cassette("TestModNotes.test_create_note__submission"): + submission = self.reddit.submission("uflrmv") + result_note = self.reddit.notes.create( + label="HELPFUL_USER", note="test note", thing=submission + ) + assert result_note.user == submission.author + assert result_note.note == "test note" + + @mock.patch("time.sleep", return_value=None) + def test_delete_note(self, _): + self.reddit.read_only = False + with self.use_cassette(): + subreddit = self.reddit.subreddit(pytest.placeholders.test_subreddit) + result_note = subreddit.mod.notes.create( + redditor=self.REDDITOR, note="test note" + ) + subreddit.mod.notes.delete( + note_id=result_note.id, redditor=result_note.user + ) + notes = list(subreddit.mod.notes.redditors(self.REDDITOR)) + assert result_note not in notes + + @mock.patch("time.sleep", return_value=None) + def test_delete_note__all_notes(self, _): + self.reddit.read_only = False + with self.use_cassette(): + subreddit = self.reddit.subreddit(pytest.placeholders.test_subreddit) + result_note = subreddit.mod.notes.create( + redditor=self.REDDITOR, note="test note" + ) + subreddit.mod.notes.delete(delete_all=True, redditor=result_note.user) + notes = list(subreddit.mod.notes.redditors(self.REDDITOR)) + assert len(notes) == 0 diff --git a/tests/integration/test_reddit.py b/tests/integration/test_reddit.py index f9aab33dd..318b32e17 100644 --- a/tests/integration/test_reddit.py +++ b/tests/integration/test_reddit.py @@ -169,6 +169,32 @@ def test_live_now__no_featured(self): with self.use_cassette(): assert self.reddit.live.now() is None + def test_notes__call__(self): + self.reddit.read_only = False + with self.use_cassette(): + notes = list( + self.reddit.notes( + pairs=[ + (self.reddit.subreddit("SubTestBot1"), "Watchful1"), + ("SubTestBot1", self.reddit.redditor("watchful12")), + ("SubTestBot1", "spez"), + ], + things=[self.reddit.submission("jlbw48")], + ) + ) + assert len(notes) == 4 + assert notes[0].user.name.lower() == "watchful1" + assert notes[1].user.name.lower() == "watchful12" + assert notes[2] is None + + def test_notes__things(self): + self.reddit.read_only = False + with self.use_cassette(): + thing = self.reddit.submission("tpbemz") + notes = list(self.reddit.notes.things(thing)) + assert len(notes) == 10 + assert notes[0].user == thing.author + def test_random_subreddit(self): names = set() with self.use_cassette(): diff --git a/tests/unit/models/listing/test_generator.py b/tests/unit/models/listing/test_generator.py index 965b18953..9ca0b9405 100644 --- a/tests/unit/models/listing/test_generator.py +++ b/tests/unit/models/listing/test_generator.py @@ -1,4 +1,6 @@ """Test praw.models.listing.generator.""" +import pytest + from praw.models.listing.generator import ListingGenerator from ... import UnitTest @@ -11,3 +13,12 @@ def test_params_are_not_modified(self): assert "limit" in generator.params assert "limit" not in params assert ("prawtest", "yes") in generator.params.items() + + def test_bad_dict(self): + generator = ListingGenerator(None, None) + with pytest.raises(ValueError) as excinfo: + generator._extract_sublist({"not_users": "test value"}) + assert excinfo.value.args[0] == ( + "The generator returned a dictionary PRAW didn't recognize. File a bug" + " report at PRAW." + ) diff --git a/tests/unit/models/listing/test_listing.py b/tests/unit/models/listing/test_listing.py index d3392f111..8a8fd8f2c 100644 --- a/tests/unit/models/listing/test_listing.py +++ b/tests/unit/models/listing/test_listing.py @@ -1,4 +1,4 @@ -from praw.models.listing.listing import ModmailConversationsListing +from praw.models.listing.listing import ModmailConversationsListing, ModNoteListing from ... import UnitTest @@ -9,3 +9,13 @@ def test_empty_conversations_list(self): ModmailConversationsListing(self.reddit, _data={"conversations": []}).after is None ) + + +class TestModNoteListing(UnitTest): + def test_has_next_page(self): + assert ( + ModNoteListing( + self.reddit, _data={"has_next_page": True, "end_cursor": "end_cursor"} + ).after + == "end_cursor" + ) diff --git a/tests/unit/models/reddit/test_subreddit.py b/tests/unit/models/reddit/test_subreddit.py index 2d298fcac..239e0b59e 100644 --- a/tests/unit/models/reddit/test_subreddit.py +++ b/tests/unit/models/reddit/test_subreddit.py @@ -95,6 +95,14 @@ def test_media_upload_500(self, connection_mock, _mock_post, mock_method): with pytest.raises(ServerError): self.reddit.subreddit("test").submit_image("Test", "/dev/null") + def test_notes_delete__invalid_args(self): + with pytest.raises(TypeError) as excinfo: + self.reddit.subreddit("SubTestBot1").mod.notes.delete(note_id="111") + assert excinfo.value.args[0] == ( + "Either the `redditor` parameter must be provided or this method must be" + " called from a Redditor instance (e.g., `redditor.notes`)." + ) + def test_pickle(self): subreddit = Subreddit( self.reddit, _data={"display_name": "name", "id": "dummy"} diff --git a/tests/unit/models/test_mod_note.py b/tests/unit/models/test_mod_note.py new file mode 100644 index 000000000..a02c14cc2 --- /dev/null +++ b/tests/unit/models/test_mod_note.py @@ -0,0 +1,15 @@ +"""Test praw.models.ModNote.""" +from praw.models.mod_note import ModNote + +from .. import UnitTest + + +class TestModNote(UnitTest): + def test_equality(self): + mod_note1 = ModNote(None, {"id": "a"}) + mod_note2 = ModNote(None, {"id": "b"}) + mod_note3 = ModNote(None, {"id": "a"}) + assert mod_note1 != mod_note2 + assert mod_note1 == mod_note3 + assert mod_note1 == "a" + assert mod_note1 != 1 diff --git a/tests/unit/models/test_mod_notes.py b/tests/unit/models/test_mod_notes.py new file mode 100644 index 000000000..ae2c1f5f5 --- /dev/null +++ b/tests/unit/models/test_mod_notes.py @@ -0,0 +1,62 @@ +"""Test praw.models.mod_notes.""" + +import pytest + +from .. import UnitTest + + +class TestBaseModNotes(UnitTest): + def test__ensure_attribute__(self): + with pytest.raises(TypeError) as excinfo: + self.reddit.subreddit("a").mod.notes._ensure_attribute( + error_message="error", redditor=None + ) + assert excinfo.value.args[0] == "error" + + def test_notes_delete__missing_note_id(self): + with pytest.raises(TypeError) as excinfo: + self.reddit.subreddit("a").mod.notes.delete(redditor="redditor") + assert ( + excinfo.value.args[0] + == "Either `note_id` or `delete_all` must be provided." + ) + + +class TestRedditModNotes(UnitTest): + def test__call__invalid_thing_type(self): + with pytest.raises(ValueError) as excinfo: + self.reddit.notes(things=[1]) + assert ( + excinfo.value.args[0] + == "Cannot get subreddit and author fields from type " + ) + + def test__call__missing_arguments(self): + with pytest.raises(TypeError) as excinfo: + self.reddit.notes() + assert ( + excinfo.value.args[0] + == "Either the `pairs`, `redditors`, `subreddits`, or `things` parameters must be provided." + ) + + def test__call__redditors_missing_subreddits(self): + with pytest.raises(TypeError) as excinfo: + self.reddit.notes(subreddits=[1]) + assert ( + excinfo.value.args[0] + == "`redditors` must be non-empty if `subreddits` is not empty." + ) + + +class TestRedditorModNotes(UnitTest): + def test_subreddits__missing_argument(self): + with pytest.raises(ValueError) as excinfo: + self.reddit.redditor("a").notes.subreddits() + assert excinfo.value.args[0] == "At least 1 subreddit must be provided." + + +class TestSubredditModNotes(UnitTest): + def test_subreddits__missing_argument(self): + with pytest.raises(ValueError) as excinfo: + self.reddit.subreddit("a").mod.notes.redditors() + assert excinfo.value.args[0] == "At least 1 redditor must be provided."