mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
Fix handling non-GET requests
The `request` parameter being passed in was just a hold-over from an earlier refactoring. Added tests to ensure that this edge case keeps working.
This commit is contained in:
@@ -86,3 +86,11 @@ def test_pydantic_model() -> None:
|
||||
r1 = client.get("/pydantic_instance").json()
|
||||
r2 = client.get("/pydantic_instance").json()
|
||||
assert r1 == r2
|
||||
|
||||
|
||||
def test_non_get() -> None:
|
||||
with TestClient(app) as client:
|
||||
response = client.put("/uncached_put")
|
||||
assert response.json() == {"value": 1}
|
||||
response = client.put("/uncached_put")
|
||||
assert response.json() == {"value": 2}
|
||||
|
||||
Reference in New Issue
Block a user