23 lines
757 B
Python
23 lines
757 B
Python
"""Test if the project thumbnail endpoint is working"""
|
|
import requests
|
|
|
|
# Test the thumbnail endpoint
|
|
url = "http://localhost:8000/files/projects/1/thumbnail"
|
|
headers = {
|
|
"Authorization": "Bearer YOUR_TOKEN_HERE" # Replace with actual token
|
|
}
|
|
|
|
try:
|
|
response = requests.get(url, headers=headers)
|
|
print(f"Status Code: {response.status_code}")
|
|
print(f"Content-Type: {response.headers.get('content-type')}")
|
|
print(f"Content-Length: {response.headers.get('content-length')}")
|
|
|
|
if response.status_code == 200:
|
|
print("✓ Thumbnail endpoint is working!")
|
|
print(f"Image size: {len(response.content)} bytes")
|
|
else:
|
|
print(f"✗ Error: {response.text}")
|
|
except Exception as e:
|
|
print(f"✗ Exception: {e}")
|