Browse Source

Fix test codes

pull/2132/head
Hironsan 1 year ago
parent
commit
34bbf26a89
2 changed files with 4 additions and 3 deletions
  1. 3
      backend/examples/tests/test_models.py
  2. 4
      backend/label_types/tests/utils.py

3
backend/examples/tests/test_models.py

@ -55,7 +55,8 @@ class TestExampleState(TestCase):
expected_progress = [{"user": member.username, "done": 0} for member in self.project.members]
expected_progress[0]["done"] = 1
expected_progress[1]["done"] = 1
self.assertEqual(progress, {"total": 2, "progress": expected_progress})
self.assertEqual(progress["total"], 2)
self.assertCountEqual(progress["progress"], expected_progress)
class TestExample(TestCase):

4
backend/label_types/tests/utils.py

@ -1,10 +1,10 @@
from model_mommy import mommy
from projects.models import BOUNDING_BOX
from projects.models import BOUNDING_BOX, SEGMENTATION
def make_label(project, **kwargs):
if project.project_type.endswith("Classification") or project.project_type == BOUNDING_BOX:
if project.project_type.endswith("Classification") or project.project_type in {BOUNDING_BOX, SEGMENTATION}:
return mommy.make("CategoryType", project=project, **kwargs)
else:
return mommy.make("SpanType", project=project, **kwargs)
Loading…
Cancel
Save