Fix: Rettet test-economic endpoint - fjernet ikke-eksisterende get_self() kald
This commit is contained in:
parent
7fd596612c
commit
41f7ae991c
@ -53,12 +53,9 @@ async def test_economic_connection():
|
|||||||
from app.services.economic_service import EconomicService
|
from app.services.economic_service import EconomicService
|
||||||
economic = EconomicService()
|
economic = EconomicService()
|
||||||
|
|
||||||
# Test 1: Fetch first page of customers
|
# Test: Fetch first page of customers
|
||||||
customers = await economic.get_customers(page=0, page_size=5)
|
customers = await economic.get_customers(page=0, page_size=5)
|
||||||
|
|
||||||
# Test 2: Get self info
|
|
||||||
self_info = await economic.get_self()
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"status": "success",
|
"status": "success",
|
||||||
"connection": "healthy",
|
"connection": "healthy",
|
||||||
@ -67,13 +64,9 @@ async def test_economic_connection():
|
|||||||
"has_agreement_token": bool(settings.ECONOMIC_AGREEMENT_GRANT_TOKEN),
|
"has_agreement_token": bool(settings.ECONOMIC_AGREEMENT_GRANT_TOKEN),
|
||||||
"read_only_mode": settings.ECONOMIC_READ_ONLY,
|
"read_only_mode": settings.ECONOMIC_READ_ONLY,
|
||||||
"dry_run_mode": settings.ECONOMIC_DRY_RUN,
|
"dry_run_mode": settings.ECONOMIC_DRY_RUN,
|
||||||
"self_info": {
|
"test_results": {
|
||||||
"agreement": self_info.get("agreementNumber") if self_info else None,
|
"customers_fetched": len(customers) if customers else 0,
|
||||||
"company": self_info.get("company", {}).get("name") if self_info else None
|
"sample_customers": [
|
||||||
},
|
|
||||||
"sample_customers": {
|
|
||||||
"count": len(customers) if customers else 0,
|
|
||||||
"first_3": [
|
|
||||||
{
|
{
|
||||||
"number": c.get("customerNumber"),
|
"number": c.get("customerNumber"),
|
||||||
"name": c.get("name"),
|
"name": c.get("name"),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user