Stats management revamping
This commit is contained in:
@@ -10,6 +10,7 @@ from app.exceptions import (
|
||||
AdminOperationException,
|
||||
)
|
||||
from app.services.admin_service import AdminService
|
||||
from app.services.stats_service import stats_service
|
||||
from models.database.marketplace_import_job import MarketplaceImportJob
|
||||
from models.database.vendor import Vendor
|
||||
|
||||
@@ -227,7 +228,7 @@ class TestAdminService:
|
||||
# Statistics Tests
|
||||
def test_get_user_statistics(self, db, test_user, test_admin):
|
||||
"""Test getting user statistics"""
|
||||
stats = self.service.get_user_statistics(db)
|
||||
stats = get_user_statistics(db)
|
||||
|
||||
assert "total_users" in stats
|
||||
assert "active_users" in stats
|
||||
@@ -244,7 +245,7 @@ class TestAdminService:
|
||||
|
||||
def test_get_vendor_statistics(self, db, test_vendor):
|
||||
"""Test getting vendor statistics"""
|
||||
stats = self.service.get_vendor_statistics(db)
|
||||
stats = stats_service.get_vendor_statistics(db)
|
||||
|
||||
assert "total_vendors" in stats
|
||||
assert "active_vendors" in stats
|
||||
@@ -291,7 +292,7 @@ class TestAdminService:
|
||||
|
||||
def test_user_statistics_empty_database(self, empty_db):
|
||||
"""Test user statistics when no users exist"""
|
||||
stats = self.service.get_user_statistics(empty_db)
|
||||
stats = stats_service.get_user_statistics(empty_db)
|
||||
|
||||
assert stats["total_users"] == 0
|
||||
assert stats["active_users"] == 0
|
||||
@@ -300,7 +301,7 @@ class TestAdminService:
|
||||
|
||||
def test_vendor_statistics_empty_database(self, empty_db):
|
||||
"""Test vendor statistics when no vendors exist"""
|
||||
stats = self.service.get_vendor_statistics(empty_db)
|
||||
stats = stats_service.get_vendor_statistics(empty_db)
|
||||
|
||||
assert stats["total_vendors"] == 0
|
||||
assert stats["active_vendors"] == 0
|
||||
|
||||
Reference in New Issue
Block a user