diff --git a/backend/tests/test_core_model.py b/backend/tests/test_core_model.py index 58e299cb..5fc09afb 100644 --- a/backend/tests/test_core_model.py +++ b/backend/tests/test_core_model.py @@ -1,13 +1,19 @@ from django.test import TestCase -from .factories import DatasetFactory, OsmUserFactory +from .factories import DatasetFactory, OsmUserFactory, AoiFactory class TestCoreModels(TestCase): + 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) + def test_dataset_creation(self): - user = OsmUserFactory(username="Test User 2", osm_id=123) - dataset = DatasetFactory(created_by=user) + self.assertEqual(self.dataset.name, "Test Dataset") + self.assertEqual(self.dataset.created_by, self.user) - self.assertEqual(dataset.name, "Test Dataset") - self.assertEqual(dataset.created_by, user) + def test_aoi_creation(self): + self.assertEqual(self.aoi.dataset, self.dataset) + self.assertEqual(self.aoi.label_status, -1)