API and database models refactoring
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
# tests/unit/models/test_database_models.py
|
||||
import pytest
|
||||
|
||||
from models.database_models import Product, Shop, Stock, User
|
||||
from models.database.product import Product
|
||||
from models.database.shop import Shop
|
||||
from models.database.stock import Stock
|
||||
from models.database.user import User
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
@@ -3,7 +3,8 @@ import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
from app.services.admin_service import AdminService
|
||||
from models.database_models import MarketplaceImportJob, Shop
|
||||
from models.database.marketplace import MarketplaceImportJob
|
||||
from models.database.shop import Shop
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
@@ -3,8 +3,8 @@ import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
from app.services.auth_service import AuthService
|
||||
from models.api_models import UserLogin, UserRegister
|
||||
from models.database_models import User
|
||||
from models.api.auth import UserLogin, UserRegister
|
||||
from models.database.user import User
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.auth
|
||||
|
||||
@@ -5,8 +5,10 @@ from datetime import datetime
|
||||
import pytest
|
||||
|
||||
from app.services.marketplace_service import MarketplaceService
|
||||
from models.api_models import MarketplaceImportRequest
|
||||
from models.database_models import MarketplaceImportJob, Shop, User
|
||||
from models.api.marketplace import MarketplaceImportRequest
|
||||
from models.database.marketplace import MarketplaceImportJob
|
||||
from models.database.shop import Shop
|
||||
from models.database.user import User
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.marketplace
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import pytest
|
||||
|
||||
from app.services.product_service import ProductService
|
||||
from models.api_models import ProductCreate
|
||||
from models.database_models import Product
|
||||
from models.api.product import ProductCreate
|
||||
from models.database.product import Product
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.products
|
||||
|
||||
@@ -3,7 +3,7 @@ import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
from app.services.shop_service import ShopService
|
||||
from models.api_models import ShopCreate, ShopProductCreate
|
||||
from models.api.shop import ShopCreate, ShopProductCreate
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.shops
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import pytest
|
||||
|
||||
from app.services.stats_service import StatsService
|
||||
from models.database_models import Product, Stock
|
||||
from models.database.product import Product
|
||||
from models.database.stock import Stock
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.stats
|
||||
|
||||
@@ -4,8 +4,9 @@ import uuid
|
||||
import pytest
|
||||
|
||||
from app.services.stock_service import StockService
|
||||
from models.api_models import StockAdd, StockCreate, StockUpdate
|
||||
from models.database_models import Product, Stock
|
||||
from models.api.stock import StockAdd, StockCreate, StockUpdate
|
||||
from models.database.product import Product
|
||||
from models.database.stock import Stock
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.stock
|
||||
|
||||
@@ -83,7 +83,7 @@ class TestCSVProcessor:
|
||||
mock_get.return_value = mock_response
|
||||
|
||||
with pytest.raises(Exception):
|
||||
self.processor._download_csv("http://example.com/nonexistent.csv")
|
||||
self.processor.download_csv("http://example.com/nonexistent.csv")
|
||||
|
||||
def test_parse_csv_content(self):
|
||||
"""Test CSV content parsing"""
|
||||
|
||||
Reference in New Issue
Block a user