Add endpoint to fetch latest posts across topics

Added endpoint for looking up latest posts across topics, see Discourse api documentation here:

https://docs.discourse.org/#tag/Posts/operation/listPosts
This commit is contained in:
Max Lancaster
2023-01-17 14:57:14 -05:00
parent 22e236a009
commit 9709744b33
4 changed files with 27 additions and 1 deletions
+5
View File
@@ -182,6 +182,11 @@ class TestTopics(ClientBaseTestCase):
@mock.patch("pydiscourse.client.requests.request")
class MiscellaneousTests(ClientBaseTestCase):
def test_latest_posts(self, request):
prepare_response(request)
r = self.client.latest_posts(before=54321)
self.assertRequestCalled(request, "GET", "/posts.json", before=54321)
def test_search(self, request):
prepare_response(request)
self.client.search("needle")