Skip to content

Commit 6ef59f0

Browse files
author
John Lyu
committed
Merge branch 'fix-no-cache' into fix
2 parents 120553a + 6f8994b commit 6ef59f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_decorator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,25 +115,25 @@ def test_alternate_injected_namespace() -> None:
115115

116116
def test_cache_control() -> None:
117117
with TestClient(app) as client:
118-
response = client.get("/uncached_put")
118+
response = client.put("/uncached_put")
119119
assert "X-FastAPI-Cache" not in response.headers
120120
assert response.json() == {"value": 1}
121121

122122
# HIT
123-
response = client.get("/uncached_put")
123+
response = client.put("/uncached_put")
124124
assert response.headers.get("X-FastAPI-Cache") == "HIT"
125125
assert response.json() == {"value": 1}
126126

127127
# no-cache
128-
response = client.get("/uncached_put", headers={"Cache-Control": "no-cache"})
128+
response = client.put("/uncached_put", headers={"Cache-Control": "no-cache"})
129129
assert response.json() == {"value": 2}
130130

131-
response = client.get("/uncached_put")
131+
response = client.put("/uncached_put")
132132
assert response.json() == {"value": 2}
133133

134134
# no-store
135-
response = client.get("/uncached_put", headers={"Cache-Control": "no-store"})
135+
response = client.put("/uncached_put", headers={"Cache-Control": "no-store"})
136136
assert response.json() == {"value": 3}
137137

138-
response = client.get("/uncached_put")
138+
response = client.put("/uncached_put")
139139
assert response.json() == {"value": 2}

0 commit comments

Comments
 (0)