-
-
Couldn't load subscription status.
- Fork 7.5k
Add search functionality to items endpoint with tests #1715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search functionality to items endpoint with tests #1715
Conversation
|
@yaswanthrajeev, thank you for the interest in project! Do you have plans to continue working on this? |
| assert response.status_code == 200 | ||
| content = response.json() | ||
| assert content["count"] == 1 | ||
| assert content["data"][0]["title"] == "Alpha Item" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also assert that item2 is NOT returned, just to be explicit about the filtering.
| assert response.status_code == 200 | ||
| content = response.json() | ||
| assert content["count"] == 2 | ||
| assert len(content["data"]) == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also assert the titles of the returned items (e.g., "Test Item 1" and "Test Item 2") so the test is stronger and doesn’t rely on implicit ordering.
|
This pull request has a merge conflict that needs to be resolved. |
|
As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR. |
Add Search Functionality to Items API
Summary
searchquery parameter to the/api/v1/items/endpoint.How to Test