Files
tilbudgivern/tests/test_fresh_offer.py
alexpolo1 26d3452d59 Add comprehensive tests for API verification, frontend integration, and PDF generation
- Implemented a new test suite for production API verification using curl, ensuring all critical endpoints respond correctly and return valid JSON.
- Added frontend integration tests to check for critical errors in the UI and verify key UI elements are present and functional.
- Created test data for quotes and project calculations to facilitate testing.
- Developed a script to check offers in the Ordrestyring system, including detailed task descriptions.
- Added tests for generating PDFs from quote data, ensuring the output is valid and contains expected information.
- Implemented a test script for the Røsevangen project, integrating with the Ordrestyring API and verifying database entries.
2025-11-07 08:02:07 +00:00

25 lines
704 B
Python

import requests
import json
# Create a completely fresh test
API_URL = "http://localhost:4031/api/ordrestyring"
# Use project 22, calculation 26 (next available)
data = {
"projectId": 22,
"calculationId": 26
}
print("🚀 Creating fresh offer without customer ID (will create new customer)...")
response = requests.post(f"{API_URL}/send-quote", json=data)
if response.status_code == 200:
result = response.json()
print(f"\n✅ Success!")
print(f"Offer ID: {result['offer']['id']}")
print(f"Offer Number: {result['offer']['number']}")
print(f"Customer: {result['offer']['customer']['name']}")
else:
print(f"\n❌ Error {response.status_code}")
print(response.text)