Implement tests for all endpoints and update documentation. Added

endpoint for getting the list of all relationships
This commit is contained in:
2025-06-24 21:28:26 +03:00
parent e6af796d7d
commit 5db6416d79
5 changed files with 80 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ def test_get_existing_author(setup_database):
response = client.get("/authors/1")
print(response.json())
assert response.status_code == 200, "Invalid response status"
assert response.json() == {"id": 1, "name": "Test Author"}, "Invalid response data"
assert response.json() == {"id": 1, "name": "Test Author", "books": []}, "Invalid response data"
def test_get_not_existing_author(setup_database):
response = client.get("/authors/2")