| import requests |
| url = 'http://127.0.0.1:5713/' |
| |
| def test_get_postlist(): |
| print() |
| urlx=url+'apostlist' |
| payload = { |
| 'userid': 3 |
| } |
| headers = {'Content-Type': 'application/json'} |
| |
| resp = requests.get(urlx, json=payload, headers=headers) |
| # print(resp.status_code) |
| print(resp.json()) |
| |
| def test_get_post(): |
| print() |
| urlx=url+'agetpost' |
| payload = { |
| 'userid': 3, |
| 'postid': 21 |
| } |
| headers = {'Content-Type': 'application/json'} |
| |
| resp = requests.get(urlx, json=payload, headers=headers) |
| # print(resp.status_code) |
| print(resp.json()) |
| |
| def test_review_post(): |
| print() |
| urlx=url+'areview' |
| payload = { |
| 'userid': 3, |
| 'postid': 21, |
| 'status': 'rejected' |
| } |
| headers = {'Content-Type': 'application/json'} |
| |
| resp = requests.get(urlx, json=payload, headers=headers) |
| # print(resp.status_code) |
| print(resp.json()) |