Loading django/contrib/gis/gdal/tests/test_geom.py +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin): self.assertEqual(json.loads(g.json), json.loads(geom.json)) self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) self.assertEqual(OGRGeometry(g.wkt), OGRGeometry(geom.json)) # Test input with some garbage content (but valid json) (#15529) geom = OGRGeometry('{"type": "Point", "coordinates": [ 100.0, 0.0 ], "other": "<test>"}') self.assertIsInstance(geom, OGRGeometry) def test02_points(self): "Testing Point objects." Loading django/contrib/gis/geometry/regex.py +1 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,4 @@ wkt_regex = re.compile(r'^(SRID=(?P<srid>\-?\d+);)?' r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)' r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$', re.I) json_regex = re.compile(r'^(\s+)?\{[\s\w,\[\]\{\}\-\."\':]+\}(\s+)?$') json_regex = re.compile(r'^(\s+)?\{.*}(\s+)?$', re.DOTALL) Loading
django/contrib/gis/gdal/tests/test_geom.py +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin): self.assertEqual(json.loads(g.json), json.loads(geom.json)) self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) self.assertEqual(OGRGeometry(g.wkt), OGRGeometry(geom.json)) # Test input with some garbage content (but valid json) (#15529) geom = OGRGeometry('{"type": "Point", "coordinates": [ 100.0, 0.0 ], "other": "<test>"}') self.assertIsInstance(geom, OGRGeometry) def test02_points(self): "Testing Point objects." Loading
django/contrib/gis/geometry/regex.py +1 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,4 @@ wkt_regex = re.compile(r'^(SRID=(?P<srid>\-?\d+);)?' r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)' r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$', re.I) json_regex = re.compile(r'^(\s+)?\{[\s\w,\[\]\{\}\-\."\':]+\}(\s+)?$') json_regex = re.compile(r'^(\s+)?\{.*}(\s+)?$', re.DOTALL)