-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
base: master
Are you sure you want to change the base?
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. |
Add Search Functionality to Items API
Summary
search
query parameter to the/api/v1/items/
endpoint.How to Test