akf-forum/tests/get_msg.py

36 lines
800 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': {
'authorID': 0,
'content': 'a',
'author': {
'name': 'Akif9748',
'avatar': 'https://www.technopat.net/sosyal/data/avatars/o/298/298223.jpg?1644694020',
'time': 1649189944864,
'admin': False,
'deleted': False,
'id': 0
},
2022-04-06 21:14:46 +03:00
'time': 1649189950166,
'threadID': 0,
'deleted': False,
'edited': False,
# Reactions: {userid: isLike (Bool)}
'react': {'0': True},
'id': 0
}
}