Skip to content

Commit

Permalink
fix: search term moved to q
Browse files Browse the repository at this point in the history
  • Loading branch information
weber-s authored and bennylope committed Sep 27, 2023
1 parent a07b122 commit 53be265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pydiscourse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,17 +844,17 @@ def invite_user_to_topic(self, user_email, topic_id):
kwargs = {"email": user_email, "topic_id": topic_id}
return self._post(f"/t/{topic_id}/invite.json", **kwargs)

def search(self, term, **kwargs):
def search(self, q, **kwargs):
"""
Args:
term:
q:
**kwargs:
Returns:
"""
kwargs["term"] = term
kwargs["q"] = q
return self._get("/search.json", **kwargs)

def badges(self, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def test_post_by_number(self, discourse_client, discourse_request):

class TestSearch:
def test_search(self, discourse_client, discourse_request):
request = discourse_request("get", "/search.json?term=needle")
discourse_client.search(term="needle")
request = discourse_request("get", "/search.json?q=needle")
discourse_client.search(q="needle")
assert request.called_once


Expand Down

0 comments on commit 53be265

Please sign in to comment.