Add end-to-end tests for parent item management
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m31s

- Implement tests for creating, editing, and deleting chores, kindness acts, and penalties.
- Add tests to verify conversion of default items to user items and restoration of system defaults upon deletion.
- Ensure proper cancellation of creation and editing actions.
- Create a comprehensive plan document outlining the test scenarios and expected behaviors.
This commit is contained in:
2026-03-12 12:22:37 -04:00
parent accf596bd7
commit f250c42e5e
32 changed files with 1995 additions and 197 deletions

View File

@@ -6,10 +6,14 @@ import os
import shutil
from api.image_api import IMAGE_TYPE_ICON, IMAGE_TYPE_PROFILE
from config.paths import get_images_dir
from db.db import task_db, reward_db, image_db
from models.image import Image
from models.reward import Reward
from models.task import Task
import logging
logger = logging.getLogger(__name__)
def populate_default_data():
@@ -124,7 +128,8 @@ def initializeImages():
"""Initialize the image database with default images if empty, and copy images to data/images/default."""
# Step 1: Create data/images/default directory if it doesn't exist
default_img_dir = os.path.join(os.path.dirname(__file__), '../data/images/default')
default_img_dir = os.path.join(get_images_dir(), 'default')
logger.info(f"Initializing images. Ensuring directory exists: {default_img_dir}")
os.makedirs(default_img_dir, exist_ok=True)
# Step 2: Copy all image files from resources/images/ to data/images/default