fix(tenancy): mock billing limit check in store creation unit test
All checks were successful
CI / ruff (push) Successful in 10s
CI / pytest (push) Successful in 50m1s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Successful in 42s
CI / deploy (push) Successful in 53s

The test was failing because can_create_store() called the billing
module's check_resource_limit() which returned False for the test
merchant (no subscription). Patched the limit check since billing
is not what this unit test exercises.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 23:47:51 +01:00
parent 395707951e
commit 9c39a9703f

View File

@@ -2,6 +2,7 @@
"""Unit tests for MerchantStoreService."""
import uuid
from unittest.mock import patch
import pytest
@@ -172,7 +173,8 @@ class TestMerchantStoreServiceCreate:
def setup_method(self):
self.service = MerchantStoreService()
def test_create_store_success(self, db, merchant_owner):
@patch.object(MerchantStoreService, "can_create_store", return_value=(True, None))
def test_create_store_success(self, _mock_limit, db, merchant_owner):
"""Test successful store creation."""
unique_id = str(uuid.uuid4())[:8]
store_data = {