fix: update waitlist tests for email i18n + audience restructuring

Pre-existing test failures after merge: enqueue payloads now include
'lang' key, and audience names changed from 'waitlist-auth' to
'newsletter' and 'waitlist-suppliers' to 'suppliers'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-23 17:03:21 +01:00
parent 84229e50f7
commit f4a8ca7a74

View File

@@ -304,7 +304,7 @@ class TestAuthRoutes:
mock_enqueue.assert_called_once_with( mock_enqueue.assert_called_once_with(
"send_waitlist_confirmation", "send_waitlist_confirmation",
{"email": "new@example.com", "intent": "signup"} {"email": "new@example.com", "intent": "signup", "lang": "en"}
) )
@pytest.mark.asyncio @pytest.mark.asyncio
@@ -393,7 +393,7 @@ class TestAuthRoutes:
"email": "test@example.com", "email": "test@example.com",
}) })
mock_create_aud.assert_called_once_with({"name": "waitlist-auth"}) mock_create_aud.assert_called_once_with({"name": "newsletter"})
mock_create_contact.assert_called_once() mock_create_contact.assert_called_once()
call_args = mock_create_contact.call_args[0][0] call_args = mock_create_contact.call_args[0][0]
assert call_args["email"] == "test@example.com" assert call_args["email"] == "test@example.com"
@@ -445,8 +445,8 @@ class TestAuthRoutes:
audience_names = [ audience_names = [
call[0][0]["name"] for call in mock_create_aud.call_args_list call[0][0]["name"] for call in mock_create_aud.call_args_list
] ]
assert "waitlist-auth" in audience_names assert "newsletter" in audience_names
assert "waitlist-suppliers" in audience_names assert "suppliers" in audience_names
contact_audience_ids = [ contact_audience_ids = [
call[0][0]["audience_id"] for call in mock_create_contact.call_args_list call[0][0]["audience_id"] for call in mock_create_contact.call_args_list
@@ -532,7 +532,7 @@ class TestSupplierRoutes:
mock_enqueue.assert_called_once_with( mock_enqueue.assert_called_once_with(
"send_waitlist_confirmation", "send_waitlist_confirmation",
{"email": "supplier@example.com", "intent": "supplier_pro"} {"email": "supplier@example.com", "intent": "supplier_pro", "lang": "en"}
) )
@pytest.mark.asyncio @pytest.mark.asyncio
@@ -874,7 +874,7 @@ class TestCaptureWaitlistEmail:
# Email should have intent="supplier_pro" (plan name) # Email should have intent="supplier_pro" (plan name)
mock_enqueue.assert_called_with( mock_enqueue.assert_called_with(
"send_waitlist_confirmation", "send_waitlist_confirmation",
{"email": "test@example.com", "intent": "supplier_pro"} {"email": "test@example.com", "intent": "supplier_pro", "lang": "en"}
) )