Skip to content

Commit

Permalink
Add test fixtures (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
samarpan1738 committed Dec 13, 2024
1 parent 4d819e8 commit d7cdf6b
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
7 changes: 7 additions & 0 deletions todo/tests/fixtures/label_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from todo.models.label import LabelModel


label_models = [
LabelModel(name="Label 1", color="#fa1e4e", createdAt="2024-11-08T10:14:35", createdBy="qMbT6M2GB65W7UHgJS4g"),
LabelModel(name="Label 2", color="#ea1e4e", createdAt="2024-11-08T10:14:35", createdBy="qMbT6M2GB65W7UHgJS4g"),
]
38 changes: 38 additions & 0 deletions todo/tests/fixtures/task_dto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from todo.dto.task_dto import TaskDTO

task_dtos = [
TaskDTO(
id="672f7c5b775ee9f4471ff1dd",
displayId="#1",
title="created rest api",
priority=1,
status="TODO",
assignee={"id": "qMbT6M2GB65W7UHgJS4g", "name": "SYSTEM"},
isAcknowledged=False,
labels=[{"name": "Beginner Friendly", "color": "#fa1e4e"}],
isDeleted=False,
startedAt="2024-11-09T15:14:35.724000",
dueAt="2024-11-09T15:14:35.724000",
createdAt="2024-11-09T15:14:35.724000",
updatedAt="2024-10-18T15:55:14.802000Z",
createdBy={"id": "xQ1CkCncM8Novk252oAj", "name": "SYSTEM"},
updatedBy={"id": "Kn5N4Z3mdvpkv0HpqUCt", "name": "SYSTEM"},
),
TaskDTO(
id="674c726ca89aab38040cb964",
displayId="#1",
title="task 2",
priority=1,
status="TODO",
assignee={"id": "qMbT6M2GB65W7UHgJS4g", "name": "SYSTEM"},
isAcknowledged=True,
labels=[{"name": "Beginner Friendly", "color": "#fa1e4e"}],
isDeleted=False,
startedAt="2024-11-09T15:14:35.724000",
dueAt="2024-11-09T15:14:35.724000",
createdAt="2024-11-09T15:14:35.724000",
updatedAt="2024-10-18T15:55:14.802000Z",
createdBy={"id": "xQ1CkCncM8Novk252oAj", "name": "SYSTEM"},
updatedBy={"id": "Kn5N4Z3mdvpkv0HpqUCt", "name": "SYSTEM"},
),
]
38 changes: 38 additions & 0 deletions todo/tests/fixtures/task_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from todo.constants.task import TaskPriority
from todo.models.task import TaskModel
from todo.constants.task import TaskStatus
from bson import ObjectId

tasks_models = [
TaskModel(
id=ObjectId(),
displayId="#1",
title="Task 1",
description="Test task 1",
priority=TaskPriority.HIGH,
status=TaskStatus.TODO,
assignee="qMbT6M2GB65W7UHgJS4g",
isAcknowledged=True,
labels=[ObjectId(), ObjectId()],
createdAt="2024-11-08T10:14:35",
updatedAt="2024-11-08T15:14:35",
createdBy="qMbT6M2GB65W7UHgJS4g",
updatedBy="qMbT6M2GB65W7UHgJS4g",
),
TaskModel(
id=ObjectId(),
displayId="#2",
title="Task 2",
description="Test task 2",
priority=TaskPriority.MEDIUM,
status=TaskStatus.IN_PROGRESS,
assignee="qMbT6M2GB65W7UHgJS4g",
isAcknowledged=True,
labels=[ObjectId(), ObjectId()],
startedAt="2024-11-09T09:14:35",
createdAt="2024-11-08T10:14:35",
updatedAt="2024-11-08T15:14:35",
createdBy="qMbT6M2GB65W7UHgJS4g",
updatedBy="qMbT6M2GB65W7UHgJS4g",
),
]

0 comments on commit d7cdf6b

Please sign in to comment.