bmc_hub/keepforlater/test_vtiger_account.py
Christian a604a3cc44 Add comprehensive test suite for vTiger integration and ticket module
- Implemented test scripts for vTiger account retrieval, contact data, and modules.
- Created a detailed test suite for the ticket module, covering database schema validation, ticket number generation, prepaid card constraints, and service logic.
- Added tests for vTiger field inspection and various queries related to accounts and sales orders.
- Introduced SQL migration scripts for the ALSO Cloud Billing foundation, including import jobs, lines, and mapping tables with necessary constraints and indices.
- Enhanced workflow columns in the import lines table to support matching and validation timestamps.
2026-06-20 03:29:51 +02:00

32 lines
810 B
Python

#!/usr/bin/env python3
"""Test vTiger account retrieval"""
import asyncio
import sys
sys.path.insert(0, '/app')
from app.services.vtiger_service import VTigerService
from app.core.config import settings
import json
async def main():
vtiger = VTigerService()
account_id = "3x957"
# Fetch account
print(f"\n=== Fetching account {account_id} ===")
account = await vtiger.get_account_by_id(account_id)
if account:
print(f"\nAccount fields ({len(account)} total):")
for key in sorted(account.keys()):
value = account[key]
if len(str(value)) > 100:
value = str(value)[:100] + "..."
print(f" {key}: {value}")
else:
print("Account not found!")
if __name__ == "__main__":
asyncio.run(main())