fix(tests): fix 7 pre-existing test failures
Some checks failed
Some checks failed
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user