fix(tests): fix 7 pre-existing test failures
Some checks failed
CI / ruff (push) Successful in 14s
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / validate (push) Has been cancelled
CI / pytest (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled

Menu tests (6): Tests expected merchant menu item id "loyalty-program"
but the actual definition in loyalty/definition.py uses "program".
Updated assertions to match the actual menu item IDs.

Wallet test (1): test_enrollment_succeeds_without_wallet_config didn't
mock the Google Wallet config, so is_configured returned True when
GOOGLE_ISSUER_ID is set in .env. Added @patch to mock config as
unconfigured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 12:34:26 +02:00
parent fd0de714a4
commit d81e9a3fa4
3 changed files with 12 additions and 8 deletions

View File

@@ -360,10 +360,14 @@ class TestEnrollmentWalletCreation:
google_wallet_service._http_client = None
google_wallet_service._credentials = None
@patch("app.modules.loyalty.services.google_wallet_service.config")
def test_enrollment_succeeds_without_wallet_config(
self, db, wt_program, test_merchant, test_customer
self, mock_config, db, wt_program, test_merchant, test_customer
):
"""Enrollment works even when Google Wallet is not configured."""
mock_config.google_issuer_id = None
mock_config.google_service_account_json = None
from app.modules.loyalty.services.card_service import card_service
card = card_service.enroll_customer(db, test_customer.id, test_merchant.id)