feat: add chore, kindness, and penalty management components
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m34s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m34s
- Implemented ChoreAssignView for assigning chores to children. - Created ChoreConfirmDialog for confirming chore completion. - Developed KindnessAssignView for assigning kindness acts. - Added PenaltyAssignView for assigning penalties. - Introduced ChoreEditView and ChoreView for editing and viewing chores. - Created KindnessEditView and KindnessView for managing kindness acts. - Developed PenaltyEditView and PenaltyView for managing penalties. - Added TaskSubNav for navigation between chores, kindness acts, and penalties.
This commit is contained in:
@@ -72,7 +72,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def task():
|
||||
"""Create a test task."""
|
||||
task = Task(name="Clean Room", points=10, is_good=True, image_id="task-icon.png")
|
||||
task = Task(name="Clean Room", points=10, type='chore', image_id="task-icon.png")
|
||||
task_db.insert({**task.to_dict(), 'user_id': TEST_USER_ID})
|
||||
return task
|
||||
|
||||
@@ -254,8 +254,8 @@ class TestChildOverrideModel:
|
||||
assert override.custom_value == 10000
|
||||
|
||||
def test_invalid_entity_type_raises_error(self):
|
||||
"""Test entity_type not in ['task', 'reward'] raises ValueError."""
|
||||
with pytest.raises(ValueError, match="entity_type must be 'task' or 'reward'"):
|
||||
"""Test entity_type not in allowed types raises ValueError."""
|
||||
with pytest.raises(ValueError, match="entity_type must be"):
|
||||
ChildOverride(
|
||||
child_id='child123',
|
||||
entity_id='task456',
|
||||
@@ -531,7 +531,7 @@ class TestChildOverrideAPIBasic:
|
||||
task_id = child_with_task['task_id']
|
||||
|
||||
# Create a second task and assign to same child
|
||||
task2 = Task(name="Do Homework", points=20, is_good=True, image_id="homework.png")
|
||||
task2 = Task(name="Do Homework", points=20, type='chore', image_id="homework.png")
|
||||
task_db.insert({**task2.to_dict(), 'user_id': TEST_USER_ID})
|
||||
|
||||
ChildQuery = Query()
|
||||
@@ -713,7 +713,7 @@ class TestIntegration:
|
||||
task_id = child_with_task_override['task_id']
|
||||
|
||||
# Create another task
|
||||
task2 = Task(name="Do Homework", points=20, is_good=True, image_id="homework.png")
|
||||
task2 = Task(name="Do Homework", points=20, type='chore', image_id="homework.png")
|
||||
task_db.insert({**task2.to_dict(), 'user_id': TEST_USER_ID})
|
||||
|
||||
# Assign both tasks directly in database
|
||||
|
||||
Reference in New Issue
Block a user