From e0d557403f980445bf363ebfe639e52874e2729a Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:59:38 +0100 Subject: [PATCH] added label creation test --- backend/tests/test_core_model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)