fix(tenancy): mock billing limit check in store creation unit test
All checks were successful
All checks were successful
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:
@@ -2,6 +2,7 @@
|
|||||||
"""Unit tests for MerchantStoreService."""
|
"""Unit tests for MerchantStoreService."""
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -172,7 +173,8 @@ class TestMerchantStoreServiceCreate:
|
|||||||
def setup_method(self):
|
def setup_method(self):
|
||||||
self.service = MerchantStoreService()
|
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."""
|
"""Test successful store creation."""
|
||||||
unique_id = str(uuid.uuid4())[:8]
|
unique_id = str(uuid.uuid4())[:8]
|
||||||
store_data = {
|
store_data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user