diff --git a/backend/tests/test_core_model.py b/backend/tests/test_core_model.py index 5fc09afb..c808ae6b 100644 --- a/backend/tests/test_core_model.py +++ b/backend/tests/test_core_model.py @@ -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): @@ -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") @@ -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)