Skip to content

Commit

Permalink
added test set up
Browse files Browse the repository at this point in the history
  • Loading branch information
nifedara committed Apr 2, 2024
1 parent f8d78da commit 094d395
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions backend/tests/test_core_model.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 094d395

Please sign in to comment.