Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/run_tests_locally.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export COMPOSE_FILE=tests/docker-compose.yml:tests/docker-compose.dev.yml:tests/
#docker compose --profile testing_integration up --build -d
docker compose down -v || true
docker compose up --build -d
docker compose exec django python manage.py makemigrations
docker compose exec django python manage.py migrate --no-input
docker compose exec django python manage.py populate_users
docker compose exec django python manage.py populate_data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def handle(self, *args, **options):
"line_2056_10fields",
"polygon_2056",
"secretlayer",
"mandatoryfield",
):
adding.append(Permission.objects.get(codename=f"add_{model}"))
modifying.append(Permission.objects.get(codename=f"change_{model}"))
Expand Down
13 changes: 10 additions & 3 deletions tests/django_oapif_tests/tests/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 4.2.11 on 2024-03-23 05:08

import uuid
# Generated by Django 5.2.9 on 2025-12-16 14:18

import django.contrib.gis.db.models.fields
import uuid
from django.db import migrations, models


Expand Down Expand Up @@ -36,6 +35,14 @@ class Migration(migrations.Migration):
'abstract': False,
},
),
migrations.CreateModel(
name='MandatoryField',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('text_mandatory_field', models.CharField(max_length=255, verbose_name='Mandatory Field')),
('geom', django.contrib.gis.db.models.fields.PointField(srid=2056, verbose_name='Geometry')),
],
),
migrations.CreateModel(
name='NoGeom_100fields',
fields=[
Expand Down
6 changes: 6 additions & 0 deletions tests/django_oapif_tests/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ class Polygon_2056(models.Model):

class SecretLayer(BaseModelWithTenFields):
geom = models.PointField(srid=2056, verbose_name=_("Geometry"))


class MandatoryField(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
text_mandatory_field = models.CharField(max_length=255, verbose_name=_("Mandatory Field"), null=False, blank=False)
geom = models.PointField(srid=2056, verbose_name=_("Geometry"))
9 changes: 9 additions & 0 deletions tests/django_oapif_tests/tests/ogc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Point_2056_10fields,
Polygon_2056,
SecretLayer,
MandatoryField,
)

ogc_api = OAPIF()
Expand Down Expand Up @@ -72,3 +73,11 @@
],
handler=DjangoModelPermissionsHandler,
)

ogc_api.register(
MandatoryField,
title="mandatory_field",
properties_fields=[
"text_mandatory_field",
],
)