Skip to content

Commit

Permalink
added label creation test
Browse files Browse the repository at this point in the history
  • Loading branch information
nifedara committed Apr 2, 2024
1 parent 57fbc02 commit e0d5574
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/tests/test_core_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.test import TestCase

from .factories import DatasetFactory, OsmUserFactory, AoiFactory
from .factories import DatasetFactory, OsmUserFactory, AoiFactory, LabelFactory


class TestCoreModels(TestCase):
Expand All @@ -9,6 +9,7 @@ def setUp(self):
self.user = OsmUserFactory(username="Test User 2", osm_id=123)
self.dataset = DatasetFactory(created_by=self.user)
self.aoi = AoiFactory(dataset=self.dataset)
self.label = LabelFactory(aoi=self.aoi)

def test_dataset_creation(self):
self.assertEqual(self.dataset.name, "Test Dataset")
Expand All @@ -17,3 +18,6 @@ def test_dataset_creation(self):
def test_aoi_creation(self):
self.assertEqual(self.aoi.dataset, self.dataset)
self.assertEqual(self.aoi.label_status, -1)

def test_label_creation(self):
self.assertEqual(self.label.aoi, self.aoi)

0 comments on commit e0d5574

Please sign in to comment.