From 18753826cd1f6634deaca0c7c121e31d02fc7e71 Mon Sep 17 00:00:00 2001 From: Jonas Linter Date: Thu, 27 Nov 2025 14:44:57 +0000 Subject: [PATCH] Updated tests. Since the endpoints are now handled by the unified webhook endpoint we have to be a touch more careful with hotel_ids in testing since it won't accept any code anymore --- tests/test_api.py | 10 ++++++++-- tests/test_data/test_form5.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index c0d0309..b67c89b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -96,6 +96,12 @@ def test_config(): "hotel_name": "Test Hotel", "username": "testuser", "password": "testpass", + }, + { + "hotel_id": "135", + "hotel_name": "Another Hotel", + "username": "anotheruser", + "password": "anotherpass", } ], "default_hotel_code": "HOTEL123", @@ -295,7 +301,7 @@ class TestWixWebhookEndpoint: def test_wix_webhook_test_endpoint(self, client, sample_wix_form_data): """Test the test endpoint works identically.""" - response = client.post("/api/webhook/wix-form/test", json=sample_wix_form_data) + response = client.post("/api/webhook/wix-form", json=sample_wix_form_data) assert response.status_code == HttpStatusCode.OK data = response.json() assert data["status"] == "success" @@ -318,7 +324,7 @@ class TestWixWebhookEndpoint: with test_form_file.open() as f: form_data = json.load(f) - response = client.post("/api/webhook/wix-form/test", json=form_data) + response = client.post("/api/webhook/wix-form", json=form_data) assert response.status_code == HttpStatusCode.OK data = response.json() assert data["status"] == "success" diff --git a/tests/test_data/test_form5.json b/tests/test_data/test_form5.json index 93dff36..92e41fd 100644 --- a/tests/test_data/test_form5.json +++ b/tests/test_data/test_form5.json @@ -124,7 +124,7 @@ }, { "label": "hotelid", - "value": "39054_001" + "value": "135" }, { "label": "hotelname",