fix: update test fixtures for VendorTheme and CustomerPreferences schemas

- Update VendorTheme fixture to use new colors dict structure
- Update theme tests to check colors dict instead of individual fields
- Update CustomerPreferencesUpdate test for preferred_language field

🤖 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 22:36:51 +01:00
parent 33c5875bc8
commit d5c9173a2e
3 changed files with 21 additions and 7 deletions

View File

@@ -93,8 +93,15 @@ def vendor_with_theme(db, middleware_test_company):
# Add custom theme # Add custom theme
theme = VendorTheme( theme = VendorTheme(
vendor_id=vendor.id, vendor_id=vendor.id,
primary_color="#FF5733", theme_name="custom",
secondary_color="#33FF57", colors={
"primary": "#FF5733",
"secondary": "#33FF57",
"accent": "#ec4899",
"background": "#ffffff",
"text": "#1f2937",
"border": "#e5e7eb",
},
logo_url="/static/vendors/themedvendor/logo.png", logo_url="/static/vendors/themedvendor/logo.png",
favicon_url="/static/vendors/themedvendor/favicon.ico", favicon_url="/static/vendors/themedvendor/favicon.ico",
custom_css="body { background: #FF5733; }", custom_css="body { background: #FF5733; }",

View File

@@ -347,8 +347,14 @@ class TestThemeLoadingFlow:
theme = VendorTheme( theme = VendorTheme(
vendor_id=vendor_with_custom_domain.id, vendor_id=vendor_with_custom_domain.id,
primary_color="#123456", colors={
secondary_color="#654321", "primary": "#123456",
"secondary": "#654321",
"accent": "#ec4899",
"background": "#ffffff",
"text": "#1f2937",
"border": "#e5e7eb",
},
) )
db.add(theme) db.add(theme)
db.commit() db.commit()

View File

@@ -159,6 +159,7 @@ class TestCustomerResponseSchema:
"phone": None, "phone": None,
"customer_number": "CUST001", "customer_number": "CUST001",
"marketing_consent": False, "marketing_consent": False,
"preferred_language": "fr",
"last_order_date": None, "last_order_date": None,
"total_orders": 5, "total_orders": 5,
"total_spent": Decimal("500.00"), "total_spent": Decimal("500.00"),
@@ -339,12 +340,12 @@ class TestCustomerPreferencesUpdateSchema:
"""Test partial update with only some fields.""" """Test partial update with only some fields."""
update = CustomerPreferencesUpdate(marketing_consent=True) update = CustomerPreferencesUpdate(marketing_consent=True)
assert update.marketing_consent is True assert update.marketing_consent is True
assert update.language is None assert update.preferred_language is None
def test_language_update(self): def test_language_update(self):
"""Test language preference update.""" """Test language preference update."""
update = CustomerPreferencesUpdate(language="fr") update = CustomerPreferencesUpdate(preferred_language="fr")
assert update.language == "fr" assert update.preferred_language == "fr"
def test_currency_update(self): def test_currency_update(self):
"""Test currency preference update.""" """Test currency preference update."""