Hello. I have a question about logical feasibility for testing. So, I have a test function which tests updating of objects Task.
General logic of testing: firstly I create such object via method - .objects.create(), then retrieve another object from test fixture, convert it to context dictionary (like payload in DRF), in transfer to POST method both initially created object and context dictionary.
Here my steps
Step 1: preliminary create connected object – TaskType, BUT I CAN’T CREATE IT WITH THE SAME NAME AS OBJECTS WHICH ARE ALREADY EXISTING IN TEXT FIXTURE (f.e., “bug”, “maintenance”)
task_type = TaskType.objects.create(
name="Enhancement",
depiction="Some_depiction"
)
Step 2: Create object – Task, BUT HERE I CAN CREATE IT WITH THE SAME NAME AS OBJECTS WHICH ARE ALREADY EXISTING IN TEXT FIXTURE
task = Task.objects.create(
name="Apply security patches",
depiction="Some depiction",
time_constraints="2025-04-12",
is_completed=False,
priority="U",
task_type=task_type
)