#49 Parcels and Districts

* refactors WFS fetching to proper POST handling
* adds authentication support to WFS handling
* reduces dummy geometry for tests to a small area to reduce test network traffic overhead
This commit is contained in:
2022-01-04 13:03:21 +01:00
parent 46e237f0e2
commit b5cf18ac7d
4 changed files with 124 additions and 48 deletions

View File

@@ -8,8 +8,9 @@ Created on: 15.12.21
from django.contrib.gis.db.models.functions import Translate
from konova.models import Geometry, GeometryConflict
from konova.settings import PARCEL_WFS_USER, PARCEL_WFS_PW
from konova.tests.test_views import BaseTestCase
from konova.utils.wfs.spatial import SpatialWFSFetcher
from konova.utils.wfs.spatial import ParcelWFSFetcher
class GeometryTestCase(BaseTestCase):
@@ -47,19 +48,21 @@ class GeometryTestCase(BaseTestCase):
self.assertEqual(0, num_conflict)
def test_wfs_fetch(self):
""" Tests the fetching functionality of SpatialWFSFetcher
""" Tests the fetching functionality of ParcelWFSFetcher
+++ Test relies on the availability of the RLP Gemarkung WFS +++
Returns:
"""
fetcher = SpatialWFSFetcher(
base_url="http://geo5.service24.rlp.de/wfs/verwaltungsgrenzen_rp.fcgi",
version="1.1.0",
geometry=self.geom_1
fetcher = ParcelWFSFetcher(
base_url="https://www.geoportal.rlp.de/registry/wfs/519",
version="2.0.0",
geometry=self.geom_1,
auth_user=PARCEL_WFS_USER,
auth_pw=PARCEL_WFS_PW
)
features = fetcher.get_features(
"vermkv:fluren_rlp"
"ave:Flurstueck",
)
self.assertNotEqual(0, len(features), msg="Spatial wfs get feature did not work!")