Add tests for event theme API functionality
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 52s
Build and Push Docker Images / build-frontend (push) Has been skipped

Introduces comprehensive tests for creating, listing, updating, and retrieving event themes. Includes scenarios with valid data, invalid data, and pagination to ensure robust API behavior. Adds necessary fixtures to support the new test cases.
This commit is contained in:
2025-03-05 12:42:06 +01:00
parent b3a4c45202
commit b384512b9c
2 changed files with 295 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
# tests/conftest.py
import uuid
from datetime import datetime, timezone
from typing import Dict
import pytest
@@ -326,3 +327,23 @@ def gift_category_fixture(db_session, mock_user, event_fixture):
db_session.add(gift_category)
db_session.commit()
return gift_category
@pytest.fixture
def theme_data() -> Dict:
return {
"name": "Animal Safari",
"description": "A wild and fun theme with safari animals",
"preview_image_url": "https://example.com/safari.jpg",
"color_palette": {
"primary": "#f4a261",
"secondary": "#2a9d8f",
"background": "#ffffff",
"text": "#264653"
},
"fonts": {
"header": "Safari Display",
"body": "Nunito Sans"
}
}