Small fixes

This commit is contained in:
Jonas Linter
2025-11-12 18:40:37 +01:00
parent f9139d82d7
commit 12072dcbc8
7 changed files with 1277 additions and 953 deletions

View File

@@ -11,6 +11,7 @@ This module tests all FastAPI endpoints including:
import base64
import gzip
import json
import uuid
from pathlib import Path
from unittest.mock import patch
@@ -263,6 +264,29 @@ class TestWixWebhookEndpoint:
data = response.json()
assert data["status"] == "success"
@pytest.mark.parametrize(
"test_form_file",
[
Path(__file__).parent / "test_data" / f"test_form{i}.json"
for i in range(1, 6)
],
ids=lambda p: p.name,
)
def test_wix_webhook_test_endpoint_with_test_forms(self, client, test_form_file):
"""Test the test endpoint works with all test form data files."""
# Skip if file doesn't exist
if not test_form_file.exists():
pytest.skip(f"{test_form_file.name} not found")
# Load test form data
with test_form_file.open() as f:
form_data = json.load(f)
response = client.post("/api/webhook/wix-form/test", json=form_data)
assert response.status_code == HttpStatusCode.OK
data = response.json()
assert data["status"] == "success"
def test_wix_webhook_updates_existing_customer(self, client):
"""Test that same contact_id updates customer instead of duplicate."""
# First submission