fix(tests): remove stale onboarding redirect tests and mock billing limits
Some checks failed
CI / ruff (push) Successful in 12s
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / pytest (push) Has been cancelled

Remove marketplace page redirect-to-onboarding tests that no longer
match the route behavior. Add can_create_store mock to tenancy store
creation tests to bypass billing limit checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 22:32:35 +01:00
parent 19d267587b
commit a1cc05cd3d
3 changed files with 18 additions and 118 deletions

View File

@@ -193,7 +193,8 @@ class TestMerchantStoreServiceCreate:
assert result["is_active"] is True
assert result["is_verified"] is False
def test_create_store_duplicate_code(self, db, merchant_owner, merchant_store):
@patch.object(MerchantStoreService, "can_create_store", return_value=(True, None))
def test_create_store_duplicate_code(self, _mock_limit, db, merchant_owner, merchant_store):
"""Test creating store with duplicate store code."""
store_data = {
"name": "Another Store",
@@ -206,7 +207,8 @@ class TestMerchantStoreServiceCreate:
with pytest.raises(StoreAlreadyExistsException):
self.service.create_store(db, merchant_owner.id, store_data)
def test_create_store_duplicate_subdomain(self, db, merchant_owner, merchant_store):
@patch.object(MerchantStoreService, "can_create_store", return_value=(True, None))
def test_create_store_duplicate_subdomain(self, _mock_limit, db, merchant_owner, merchant_store):
"""Test creating store with duplicate subdomain."""
store_data = {
"name": "Another Store",
@@ -219,7 +221,8 @@ class TestMerchantStoreServiceCreate:
with pytest.raises(StoreValidationException):
self.service.create_store(db, merchant_owner.id, store_data)
def test_create_store_nonexistent_merchant(self, db):
@patch.object(MerchantStoreService, "can_create_store", return_value=(True, None))
def test_create_store_nonexistent_merchant(self, _mock_limit, db):
"""Test creating store for non-existent merchant."""
store_data = {
"name": "No Merchant Store",
@@ -232,7 +235,8 @@ class TestMerchantStoreServiceCreate:
with pytest.raises(MerchantNotFoundException):
self.service.create_store(db, 99999, store_data)
def test_create_store_creates_default_roles(self, db, merchant_owner):
@patch.object(MerchantStoreService, "can_create_store", return_value=(True, None))
def test_create_store_creates_default_roles(self, _mock_limit, db, merchant_owner):
"""Test that default roles are created for new store."""
from app.modules.tenancy.models.store import Role