Skip to content

Commit cac757e

Browse files
committed
PreRev 4.3.8 - 0227 测试组件
1 parent 7f3975f commit cac757e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

comiknet_test.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from time import sleep
2+
import pytest
3+
import requests
4+
import os
5+
6+
def test_login():
7+
username = os.getenv("username")
8+
password = os.getenv("password")
9+
10+
res = requests.get("http://localhost:8000/login", data={
11+
"username": username,
12+
"password": password
13+
})
14+
15+
assert res.status_code == 200
16+
print(res.text)
17+
18+
if __name__ == "__main__":
19+
test_login()
20+

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
app.add_middleware(
2828
CORSMiddleware,
29-
allow_origins=["http://localhost:5173"],
29+
allow_origins=["http://localhost:5173","*"],
3030
allow_credentials=True,
3131
allow_methods=["*"],
3232
allow_headers=["*"],

0 commit comments

Comments
 (0)