Skip to content

Commit

Permalink
added Model factory
Browse files Browse the repository at this point in the history
  • Loading branch information
nifedara committed Apr 2, 2024
1 parent e0d5574 commit b8672fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backend/tests/factories.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import factory

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


class OsmUserFactory(factory.django.DjangoModelFactory):
Expand Down Expand Up @@ -37,3 +37,14 @@ class Meta:

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


class ModelFactory(factory.django.DjangoModelFactory):

class Meta:
model = Model

dataset = factory.SubFactory(DatasetFactory)
name = "Test Model"
created_by = factory.SubFactory(OsmUserFactory)
status = -1

0 comments on commit b8672fc

Please sign in to comment.