import auth_utils
import db

# Get admin user
res = db.execute_query("SELECT id, email, role FROM users WHERE email='admin@radionica3d.com'")
admin = res[0]
token = auth_utils.create_access_token({"id": admin['id'], "role": admin['role'], "email": admin['email']})

print(f"Token: {token}")

import requests
resp = requests.get("http://localhost:8000/orders/admin/list?lang=en", headers={"Authorization": f"Bearer {token}"})
print(f"Status: {resp.status_code}")
print(f"Body: {resp.text}")
