erase comments
This commit is contained in:
parent
439f1f2997
commit
ab5702677b
1 changed files with 2 additions and 5 deletions
|
|
@ -105,16 +105,14 @@ class TestSendfile:
|
|||
"""
|
||||
file_content = b"this is file content"
|
||||
file_obj: IO[bytes] = io.BytesIO(file_content)
|
||||
|
||||
# 2. send_file 함수에 as_attachment=True 인자를 추가합니다.
|
||||
|
||||
rv = flask.send_file(
|
||||
file_obj,
|
||||
download_name="test.txt",
|
||||
mimetype="text/plain",
|
||||
as_attachment=True, # <-- 이 부분을 추가하세요.
|
||||
as_attachment=True,
|
||||
)
|
||||
|
||||
# 3. 응답 검증
|
||||
assert rv.status_code == 200
|
||||
assert rv.direct_passthrough
|
||||
|
||||
|
|
@ -122,7 +120,6 @@ class TestSendfile:
|
|||
|
||||
assert rv.data == file_content
|
||||
assert rv.mimetype == "text/plain"
|
||||
# 이제 이 assert문이 정상적으로 통과합니다.
|
||||
assert "attachment; filename=test.txt" in rv.headers["Content-Disposition"]
|
||||
rv.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue