chore: format files in API server (#8292)
This commit is contained in:
parent
647813a6ab
commit
97e21ba21c
20 changed files with 173 additions and 373 deletions
|
|
@ -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"]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue