marketplace refactoring
This commit is contained in:
@@ -12,7 +12,7 @@ class TestAuthentication:
|
||||
"/api/v1/admin/users",
|
||||
"/api/v1/admin/shops",
|
||||
"/api/v1/marketplace/import-jobs",
|
||||
"/api/v1/product",
|
||||
"/api/v1/marketplace/product",
|
||||
"/api/v1/shop",
|
||||
"/api/v1/stats",
|
||||
"/api/v1/stock",
|
||||
@@ -26,7 +26,7 @@ class TestAuthentication:
|
||||
"""Test protected endpoints with invalid token"""
|
||||
headers = {"Authorization": "Bearer invalid_token_here"}
|
||||
|
||||
response = client.get("/api/v1/product", headers=headers)
|
||||
response = client.get("/api/v1/marketplace/product", headers=headers)
|
||||
assert response.status_code == 401 # Token is not valid
|
||||
|
||||
def test_debug_direct_bearer(self, client):
|
||||
@@ -49,7 +49,7 @@ class TestAuthentication:
|
||||
|
||||
# Test 2: Try a regular endpoint that uses get_current_user
|
||||
response2 = client.get(
|
||||
"/api/v1/product"
|
||||
"/api/v1/marketplace/product"
|
||||
) # or any endpoint with get_current_user
|
||||
print(f"Regular endpoint - Status: {response2.status_code}")
|
||||
try:
|
||||
@@ -64,12 +64,12 @@ class TestAuthentication:
|
||||
if hasattr(route, "path") and hasattr(route, "methods"):
|
||||
print(f"{list(route.methods)} {route.path}")
|
||||
|
||||
print("\n=== Testing Product Endpoint Variations ===")
|
||||
print("\n=== Testing MarketplaceProduct Endpoint Variations ===")
|
||||
variations = [
|
||||
"/api/v1/product", # Your current attempt
|
||||
"/api/v1/product/", # With trailing slash
|
||||
"/api/v1/product/list", # With list endpoint
|
||||
"/api/v1/product/all", # With all endpoint
|
||||
"/api/v1/marketplace/product", # Your current attempt
|
||||
"/api/v1/marketplace/product/", # With trailing slash
|
||||
"/api/v1/marketplace/product/list", # With list endpoint
|
||||
"/api/v1/marketplace/product/all", # With all endpoint
|
||||
]
|
||||
|
||||
for path in variations:
|
||||
|
||||
Reference in New Issue
Block a user