Skip to content

Commit 344ae16

Browse files
authored
Fixed RelatedGeoModelTest.test_related_union_aggregate() test on Oracle and GEOS 3.12+.
1 parent ca3e048 commit 344ae16

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/gis_tests/relatedapp/tests.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ def test_related_union_aggregate(self):
100100
self.assertEqual(type(u3), MultiPoint)
101101

102102
# Ordering of points in the result of the union is not defined and
103-
# implementation-dependent (DB backend, GEOS version)
104-
self.assertEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u1})
105-
self.assertEqual({p.ewkt for p in ref_u2}, {p.ewkt for p in u2})
106-
self.assertEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u3})
103+
# implementation-dependent (DB backend, GEOS version).
104+
tests = [
105+
(u1, ref_u1),
106+
(u2, ref_u2),
107+
(u3, ref_u1),
108+
]
109+
for union, ref in tests:
110+
for point, ref_point in zip(sorted(union), sorted(ref), strict=True):
111+
self.assertIs(point.equals_exact(ref_point, tolerance=6), True)
107112

108113
def test05_select_related_fk_to_subclass(self):
109114
"""

0 commit comments

Comments
 (0)