calendar features
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-26 14:45:00 +09:00
parent b98034b616
commit 64171196b6
18 changed files with 2189 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import requests
import json
import sys
def test_calendar_entry_creation():
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyOSIsImVtYWlsIjoidGVzdDJAZXhhbXBsZS5jb20iLCJleHAiOjE3NTg4NjQwMzV9.Ap4ZD5EtwhLXRtm6KjuFvXMlk6XA-3HtMbaGEu9jX6M"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {token}"
}
data = {
"entry_date": "2025-09-30", # Использую другую дату, чтобы избежать конфликта
"entry_type": "period",
"flow_intensity": "medium",
"notes": "Test entry created via Python script"
}
url = "http://localhost:8004/api/v1/calendar/entries"
try:
response = requests.post(url, headers=headers, json=data)
print(f"Статус ответа: {response.status_code}")
print(f"Текст ответа: {response.text}")
if response.status_code == 201:
print("✅ Тест успешно пройден! Запись календаря создана.")
return 0
else:
print(f"❌ Тест не пройден. Код ответа: {response.status_code}")
return 1
except Exception as e:
print(f"❌ Ошибка при выполнении запроса: {str(e)}")
return 1
if __name__ == "__main__":
sys.exit(test_calendar_entry_creation())