From f8d78dac3d914d2e688ac84faa9ffb23e18a2a35 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:22:11 +0100 Subject: [PATCH] added aoi factory --- backend/tests/factories.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/tests/factories.py b/backend/tests/factories.py index eca34494..243db6f5 100644 --- a/backend/tests/factories.py +++ b/backend/tests/factories.py @@ -1,7 +1,9 @@ import factory from login.models import OsmUser -from core.models import Dataset +from core.models import Dataset, AOI + +from django.contrib.gis.geos import GEOSGeometry class OsmUserFactory(factory.django.DjangoModelFactory): @@ -19,3 +21,12 @@ class Meta: name = "Test Dataset" created_by = factory.SubFactory(OsmUserFactory) status = -1 + + +class AoiFactory(factory.django.DjangoModelFactory): + class Meta: + model = AOI + + geom = GEOSGeometry("POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))", srid=4326) + dataset = factory.SubFactory(DatasetFactory) + label_status = -1