-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_reset.py
More file actions
30 lines (25 loc) · 819 Bytes
/
test_reset.py
File metadata and controls
30 lines (25 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
import json
def test_reset_password():
url = "http://localhost:5000/api/auth/forgot-password"
data = {
"email": "1836078388@qq.com",
"code": "324614",
"newPassword": "newpassword123"
}
headers = {
"Content-Type": "application/json"
}
print(f"发送重置密码请求: {data}")
try:
response = requests.post(url, json=data, headers=headers)
print(f"状态码: {response.status_code}")
print(f"响应内容: {response.text}")
if response.status_code == 200:
print("密码重置成功验证通过!")
else:
print("密码重置失败!")
except Exception as e:
print(f"请求发生异常: {e}")
if __name__ == "__main__":
test_reset_password()