localist/test_requests/event_post.py

24 lines
591 B
Python

import requests
url = "http://127.0.0.1:8000/api/event"
data = {
"name": "Test Event 3",
"description": "this is a test",
"url": "https://www.domdit.com",
"address": "31 Fleetwood Dr Hazlet Nj",
"status": "scheduled",
"price": "10.00",
"require_rsvp": False,
"start_time": "2026-06-14T01:34:39Z",
"end_time": "2026-08-14T01:34:38Z",
"rain_date": "2026-06-15T01:34:42Z",
"email": "me@domdit.com",
"phone_number": "",
"categories": [1],
"tags": ["tag1", "tag2", "tag4"]
}
resp = requests.post(url, json=data)
print(resp.status_code)