akf-forum/util/tests/get_thread.py

32 lines
708 B
Python
Raw Normal View History

2022-04-03 22:03:47 +03:00
import requests
# Headers for login to Akf-forum
headers = {
"username": "testUser",
"password": "testPassword"
}
2022-04-06 21:14:46 +03:00
r = requests.get("http://localhost:3000/api/threads/0/", headers=headers)
2022-04-03 22:03:47 +03:00
print(r.json())
example_response = {
"status": 200,
"result": {
"author": {
"name": "Akif9748",
"avatar": "https://www.technopat.net/sosyal/data/avatars/o/298/298223.jpg?1644694020",
"time": 1647895891332,
"admin": False,
"deleted": False,
2022-08-11 01:11:07 +03:00
"id": "0"
2022-04-03 22:03:47 +03:00
},
"title": "First Thread",
2022-08-11 01:11:07 +03:00
"messages": ["0", "1", "2", "3"],
2022-04-03 22:03:47 +03:00
"time": 1647895907054,
"deleted": False,
2022-08-11 01:11:07 +03:00
"id": "0"
2022-04-03 22:03:47 +03:00
}
}