fix(tests): remove stale onboarding redirect tests and mock billing limits
Some checks failed
Some checks failed
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user