2026.03.29 20:00 Gitea_manager javítás előtt
This commit is contained in:
29
test_registration_smtp.py
Normal file
29
test_registration_smtp.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
import json
|
||||
import time
|
||||
|
||||
email = f"smtp_tester_{int(time.time())}@example.com"
|
||||
url = "http://localhost:8000/api/v1/auth/register"
|
||||
payload = {
|
||||
"email": email,
|
||||
"password": "TestPassword123!",
|
||||
"first_name": "Test",
|
||||
"last_name": "SMTP",
|
||||
"region_code": "HU",
|
||||
"lang": "hu"
|
||||
}
|
||||
|
||||
data = json.dumps(payload).encode('utf-8')
|
||||
req = urllib.request.Request(url, data=data, headers={'Content-Type': 'application/json'})
|
||||
|
||||
try:
|
||||
print(f"Registering: {email}")
|
||||
resp = urllib.request.urlopen(req, timeout=20.0)
|
||||
print(f"Status: {resp.status}")
|
||||
print(f"Response: {resp.read().decode('utf-8')}")
|
||||
except urllib.error.HTTPError as e:
|
||||
print(f"HTTPError: {e.code}")
|
||||
print(f"Response: {e.read().decode('utf-8')}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
Reference in New Issue
Block a user