chore: format files in API server (#8292)

This commit is contained in:
sriram veeraghanta 2025-12-10 23:50:01 +05:30 committed by GitHub
parent 647813a6ab
commit 97e21ba21c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 173 additions and 373 deletions

View file

@ -10,9 +10,7 @@ class TestLabelSerializer:
@pytest.mark.django_db
def test_label_serializer_create_valid_data(self, db, workspace):
"""Test creating a label with valid data"""
project = Project.objects.create(
name="Test Project", identifier="TEST", workspace=workspace
)
project = Project.objects.create(name="Test Project", identifier="TEST", workspace=workspace)
serializer = LabelSerializer(
data={"name": "Test Label"},
@ -30,14 +28,10 @@ class TestLabelSerializer:
@pytest.mark.django_db
def test_label_serializer_create_duplicate_name(self, db, workspace):
"""Test creating a label with a duplicate name"""
project = Project.objects.create(
name="Test Project", identifier="TEST", workspace=workspace
)
project = Project.objects.create(name="Test Project", identifier="TEST", workspace=workspace)
Label.objects.create(name="Test Label", project=project)
serializer = LabelSerializer(
data={"name": "Test Label"}, context={"project_id": project.id}
)
serializer = LabelSerializer(data={"name": "Test Label"}, context={"project_id": project.id})
assert not serializer.is_valid()
assert serializer.errors == {"name": ["LABEL_NAME_ALREADY_EXISTS"]}