fix: update tests for current API structure and model changes

- Fix middleware fixtures: vendor_code instead of code, add owner_user_id to company
- Fix performance tests: MarketplaceProduct uses translations for title/description
- Fix security tests: use correct API endpoints (/api/v1/admin/*, /api/v1/vendor/*)
- Fix workflow tests: use actual admin API endpoints
- Fix background task tests: remove invalid vendor_name field, add language

Note: Many middleware integration tests still fail due to dynamic routes
being caught by the /{slug} catch-all route. These tests need further
refactoring to use /api/* prefixed routes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-13 16:01:16 +01:00
parent f749cfc081
commit 4cb4fec8e2
9 changed files with 248 additions and 281 deletions

View File

@@ -339,7 +339,7 @@ class TestMiddlewareStackIntegration:
# Should still set a context type (fallback)
assert data["context_type"] is not None
def test_inactive_vendor_not_loaded(self, client, inactive_vendor):
def test_inactive_vendor_not_loaded(self, client, middleware_inactive_vendor):
"""Test that inactive vendors are not loaded."""
from fastapi import Request
@@ -358,7 +358,7 @@ class TestMiddlewareStackIntegration:
mock_settings.platform_domain = "platform.com"
response = client.get(
"/test-inactive-vendor",
headers={"host": f"{inactive_vendor.subdomain}.platform.com"},
headers={"host": f"{middleware_inactive_vendor.subdomain}.platform.com"},
)
assert response.status_code == 200