marketplace refactoring
This commit is contained in:
@@ -10,8 +10,8 @@ class TestIntegrationFlows:
|
||||
"""Test complete product creation and management workflow"""
|
||||
# 1. Create a product
|
||||
product_data = {
|
||||
"product_id": "FLOW001",
|
||||
"title": "Integration Test Product",
|
||||
"marketplace_product_id": "FLOW001",
|
||||
"title": "Integration Test MarketplaceProduct",
|
||||
"description": "Testing full workflow",
|
||||
"price": "29.99",
|
||||
"brand": "FlowBrand",
|
||||
@@ -21,7 +21,7 @@ class TestIntegrationFlows:
|
||||
}
|
||||
|
||||
response = client.post(
|
||||
"/api/v1/product", headers=auth_headers, json=product_data
|
||||
"/api/v1/marketplace/product", headers=auth_headers, json=product_data
|
||||
)
|
||||
assert response.status_code == 200
|
||||
product = response.json()
|
||||
@@ -38,16 +38,16 @@ class TestIntegrationFlows:
|
||||
|
||||
# 3. Get product with stock info
|
||||
response = client.get(
|
||||
f"/api/v1/product/{product['product_id']}", headers=auth_headers
|
||||
f"/api/v1/marketplace/product/{product['marketplace_product_id']}", headers=auth_headers
|
||||
)
|
||||
assert response.status_code == 200
|
||||
product_detail = response.json()
|
||||
assert product_detail["stock_info"]["total_quantity"] == 50
|
||||
|
||||
# 4. Update product
|
||||
update_data = {"title": "Updated Integration Test Product"}
|
||||
update_data = {"title": "Updated Integration Test MarketplaceProduct"}
|
||||
response = client.put(
|
||||
f"/api/v1/product/{product['product_id']}",
|
||||
f"/api/v1/marketplace/product/{product['marketplace_product_id']}",
|
||||
headers=auth_headers,
|
||||
json=update_data,
|
||||
)
|
||||
@@ -55,7 +55,7 @@ class TestIntegrationFlows:
|
||||
|
||||
# 5. Search for product
|
||||
response = client.get(
|
||||
"/api/v1/product?search=Updated Integration", headers=auth_headers
|
||||
"/api/v1/marketplace/product?search=Updated Integration", headers=auth_headers
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.json()["total"] == 1
|
||||
@@ -75,14 +75,14 @@ class TestIntegrationFlows:
|
||||
|
||||
# 2. Create a product
|
||||
product_data = {
|
||||
"product_id": "SHOPFLOW001",
|
||||
"title": "Shop Flow Product",
|
||||
"marketplace_product_id": "SHOPFLOW001",
|
||||
"title": "Shop Flow MarketplaceProduct",
|
||||
"price": "15.99",
|
||||
"marketplace": "ShopFlow",
|
||||
}
|
||||
|
||||
response = client.post(
|
||||
"/api/v1/product", headers=auth_headers, json=product_data
|
||||
"/api/v1/marketplace/product", headers=auth_headers, json=product_data
|
||||
)
|
||||
assert response.status_code == 200
|
||||
product = response.json()
|
||||
|
||||
Reference in New Issue
Block a user