Add search functionality to items endpoint with tests#1715
Add search functionality to items endpoint with tests#1715yaswanthrajeev wants to merge 3 commits intofastapi:masterfrom
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.
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 No newline at end of file |
There was a problem hiding this comment.
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