import requests BASE = "https://jsonplaceholder.typicode.com" def test_post_create_post_status_201(): payload = {"title": "qa test", "body": "automated test run", "userId": 1} r = requests.post(f"{BASE}/posts", json=payload) assert r.status_code == 201 assert r.json()["title"] == "qa test" def test_post_create_post_missing_title(): payload = {"body": "no title field", "userId": 1} r = requests.post(f"{BASE}/posts", json=payload) assert r.status_code == 201 assert "id" in r.json() def test_post_create_post_empty_payload(): payload = {} r = requests.post(f"{BASE}/posts", json=payload) assert r.status_code == 201 assert "id" in r.json()