Skip to content

Commit

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

from .factories import DatasetFactory, OsmUserFactory, AoiFactory, LabelFactory
from .factories import (
DatasetFactory,
OsmUserFactory,
AoiFactory,
LabelFactory,
ModelFactory,
)


class TestCoreModels(TestCase):
Expand All @@ -10,6 +16,7 @@ def setUp(self):
self.dataset = DatasetFactory(created_by=self.user)
self.aoi = AoiFactory(dataset=self.dataset)
self.label = LabelFactory(aoi=self.aoi)
self.model = ModelFactory(dataset=self.dataset, created_by=self.user)

def test_dataset_creation(self):
self.assertEqual(self.dataset.name, "Test Dataset")
Expand All @@ -21,3 +28,9 @@ def test_aoi_creation(self):

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

def test_model_creation(self):
self.assertEqual(self.model.name, "Test Model")
self.assertEqual(self.model.dataset, self.dataset)
self.assertEqual(self.model.created_by, self.user)
self.assertEqual(self.model.status, -1)

0 comments on commit 93965fd

Please sign in to comment.