Skip to content

Commit

Permalink
added training factory
Browse files Browse the repository at this point in the history
  • Loading branch information
nifedara committed Apr 2, 2024
1 parent 93965fd commit e1cb21a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 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, Model
from core.models import Dataset, AOI, Label, Model, Training


class OsmUserFactory(factory.django.DjangoModelFactory):
Expand Down Expand Up @@ -48,3 +48,16 @@ class Meta:
name = "Test Model"
created_by = factory.SubFactory(OsmUserFactory)
status = -1


class TrainingFactory(factory.django.DjangoModelFactory):

class Meta:
model = Training

model = factory.SubFactory(ModelFactory)
status = "SUBMITTED"
zoom_level = [20, 21]
created_by = factory.SubFactory(OsmUserFactory)
epochs = 3
batch_size = 24

0 comments on commit e1cb21a

Please sign in to comment.