akf-forum/tests/get_msg.py

35 lines
783 B
Python
Raw Normal View History

import requests
2022-04-06 21:14:46 +03:00
# Headers for login to Akf-forum
headers = {
"username": "testUser",
"password": "testPassword"
}
2022-04-03 22:03:47 +03:00
r = requests.get("http://localhost:3000/api/messages/1/", headers=headers)
print(r.json())
example_response = {
2022-04-06 21:14:46 +03:00
'status': 200,
'result': {
'content': 'a',
'author': {
'name': 'Akif9748',
'avatar': 'https://www.technopat.net/sosyal/data/avatars/o/298/298223.jpg?1644694020',
'time': 1649189944864,
'admin': False,
'deleted': False,
2022-08-11 01:11:07 +03:00
'id': "0"
},
2022-04-06 21:14:46 +03:00
'time': 1649189950166,
2022-08-11 01:11:07 +03:00
'threadID': "0",
2022-04-06 21:14:46 +03:00
'deleted': False,
'edited': False,
# Reactions: {userid: isLike (Bool)}
'react': {'0': True},
2022-08-11 01:11:07 +03:00
'id': "0"
}
}