Skip to content

Commit

Permalink
added Label factory
Browse files Browse the repository at this point in the history
  • Loading branch information
nifedara committed Apr 2, 2024
1 parent 094d395 commit 57fbc02
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions backend/tests/factories.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import factory

from login.models import OsmUser
from core.models import Dataset, AOI

from django.contrib.gis.geos import GEOSGeometry
from core.models import Dataset, AOI, Label


class OsmUserFactory(factory.django.DjangoModelFactory):
Expand All @@ -27,6 +25,15 @@ class AoiFactory(factory.django.DjangoModelFactory):
class Meta:
model = AOI

geom = GEOSGeometry("POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))", srid=4326)
geom = "POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))"
dataset = factory.SubFactory(DatasetFactory)
label_status = -1


class LabelFactory(factory.django.DjangoModelFactory):

class Meta:
model = Label

aoi = factory.SubFactory(AoiFactory)
geom = "POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))"

0 comments on commit 57fbc02

Please sign in to comment.