diff options
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 8cac07812..51da0d879 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -2535,6 +2535,20 @@ class GeomaticTest(FindInit, TestCase): base_find = models.BaseFind.objects.get(pk=base_find.pk) + # with point + geom = GEOSGeometry("POINT({} {} {})".format(2, 43, 1), srid=4326) + base_find.point = geom + base_find.multi_polygon = None + base_find.save() + base_find = models.BaseFind.objects.get(pk=base_find.pk) + dic = {"centroid": (2.0, 43.0)} + res = base_find.get_geo_items(get_polygons=True) + self.assertEqual(dic, res) + res = base_find.get_geo_items(get_polygons=False) + self.assertEqual(dic, res) + + # with multi-polygon + base_find = models.BaseFind.objects.get(pk=base_find.pk) limit = ( "MULTIPOLYGON(((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2))," "((6 3,9 2,9 4,6 3)))" |