feat(입출고): 입고증 사진 왼쪽·오른쪽 회전 — 돌린 상태로 저장
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -225,6 +225,12 @@ def body(c):
|
||||
img = c.get("/inout/photos/%d" % pids[0])
|
||||
assert img.status_code == 200 and img.content == JPEG and img.headers["content-type"] == "image/jpeg"
|
||||
assert img.headers["x-content-type-options"] == "nosniff" and "sandbox" in img.headers["content-security-policy"]
|
||||
# 돌린 사진이 캐시에 남지 않게 — 매번 확인(no-cache + ETag), 같으면 304
|
||||
assert "no-cache" in img.headers["cache-control"] and img.headers["etag"]
|
||||
assert c.get("/inout/photos/%d" % pids[0], headers={"If-None-Match": img.headers["etag"]}).status_code == 304
|
||||
# 내용이 가짜 JPEG 이면 원본 그대로, 안내만(400)
|
||||
r = c.post("/inout/orders/%d/photos/%d/rotate?degrees=90" % (oid3, pids[0]))
|
||||
assert r.status_code == 400 and r.json()["error"] and c.get("/inout/photos/%d" % pids[0]).content == JPEG, r.text
|
||||
page = c.get("/inout/orders/%d" % oid3).text
|
||||
assert 'data-photo="%d"' % pids[0] in page and 'src="/inout/photos/%d"' % pids[0] in page
|
||||
rid3 = got["receipts"][0]["id"]
|
||||
@@ -234,6 +240,7 @@ def body(c):
|
||||
who["u"] = viewer
|
||||
assert c.get("/inout/photos/%d" % pids[0]).status_code == 200 # 모듈 권한이면 보기는 됨
|
||||
assert c.post("/inout/orders/%d/photos/%d/delete" % (oid3, pids[0])).status_code == 403
|
||||
assert c.post("/inout/orders/%d/photos/%d/rotate?degrees=90" % (oid3, pids[0])).status_code == 403
|
||||
who["u"] = U("nobody-%s@t.local" % tag, inout=False)
|
||||
assert c.get("/inout/photos/%d" % pids[0]).status_code == 403
|
||||
who["u"] = wh
|
||||
|
||||
Reference in New Issue
Block a user