shop product refactoring
This commit is contained in:
@@ -61,22 +61,22 @@ class TestIntegrationFlows:
|
||||
assert response.json()["total"] == 1
|
||||
|
||||
def test_product_workflow(self, client, auth_headers):
|
||||
"""Test shop creation and product management workflow"""
|
||||
# 1. Create a shop
|
||||
shop_data = {
|
||||
"shop_code": "FLOWSHOP",
|
||||
"shop_name": "Integration Flow Shop",
|
||||
"description": "Test shop for integration",
|
||||
"""Test vendor creation and product management workflow"""
|
||||
# 1. Create a vendor
|
||||
vendor_data = {
|
||||
"vendor_code": "FLOWSHOP",
|
||||
"vendor_name": "Integration Flow Shop",
|
||||
"description": "Test vendor for integration",
|
||||
}
|
||||
|
||||
response = client.post("/api/v1/shop", headers=auth_headers, json=shop_data)
|
||||
response = client.post("/api/v1/vendor ", headers=auth_headers, json=vendor_data)
|
||||
assert response.status_code == 200
|
||||
shop = response.json()
|
||||
vendor = response.json()
|
||||
|
||||
# 2. Create a product
|
||||
product_data = {
|
||||
"marketplace_product_id": "SHOPFLOW001",
|
||||
"title": "Shop Flow MarketplaceProduct",
|
||||
"title": "Vendor Flow MarketplaceProduct",
|
||||
"price": "15.99",
|
||||
"marketplace": "ShopFlow",
|
||||
}
|
||||
@@ -87,11 +87,11 @@ class TestIntegrationFlows:
|
||||
assert response.status_code == 200
|
||||
product = response.json()
|
||||
|
||||
# 3. Add product to shop (if endpoint exists)
|
||||
# This would test the shop-product association
|
||||
# 3. Add product to vendor (if endpoint exists)
|
||||
# This would test the vendor -product association
|
||||
|
||||
# 4. Get shop details
|
||||
response = client.get(f"/api/v1/shop/{shop['shop_code']}", headers=auth_headers)
|
||||
# 4. Get vendor details
|
||||
response = client.get(f"/api/v1/vendor /{vendor ['vendor_code']}", headers=auth_headers)
|
||||
assert response.status_code == 200
|
||||
|
||||
def test_stock_operations_workflow(self, client, auth_headers):
|
||||
|
||||
Reference in New Issue
Block a user