mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #33476 -- Refactored code to strictly match 88 characters line length.
This commit is contained in:
@@ -36,12 +36,14 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
||||
'{"name":"EPSG:4326"}},"coordinates":[-95.363151,29.763374]}'
|
||||
)
|
||||
victoria_json = json.loads(
|
||||
'{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],'
|
||||
'{"type":"Point",'
|
||||
'"bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],'
|
||||
'"coordinates":[-123.305196,48.462611]}'
|
||||
)
|
||||
chicago_json = json.loads(
|
||||
'{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},'
|
||||
'"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}'
|
||||
'"bbox":[-87.65018,41.85039,-87.65018,41.85039],'
|
||||
'"coordinates":[-87.65018,41.85039]}'
|
||||
)
|
||||
if "crs" in connection.features.unsupported_geojson_options:
|
||||
del houston_json["crs"]
|
||||
@@ -131,8 +133,10 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
||||
if connection.ops.oracle:
|
||||
# No precision parameter for Oracle :-/
|
||||
gml_regex = re.compile(
|
||||
r'^<gml:Point srsName="EPSG:4326" xmlns:gml="http://www.opengis.net/gml">'
|
||||
r'<gml:coordinates decimal="\." cs="," ts=" ">-104.60925\d+,38.25500\d+ '
|
||||
r'^<gml:Point srsName="EPSG:4326" '
|
||||
r'xmlns:gml="http://www.opengis.net/gml">'
|
||||
r'<gml:coordinates decimal="\." cs="," ts=" ">'
|
||||
r"-104.60925\d+,38.25500\d+ "
|
||||
r"</gml:coordinates></gml:Point>"
|
||||
)
|
||||
else:
|
||||
@@ -588,7 +592,8 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
||||
# to pass into GEOS `equals_exact`.
|
||||
tol = 0.000000001
|
||||
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.1)) FROM "geoapp_country"
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.1))
|
||||
# FROM "geoapp_country"
|
||||
# WHERE "geoapp_country"."name" = 'San Marino';
|
||||
ref = fromstr("MULTIPOLYGON(((12.4 44,12.5 44,12.5 43.9,12.4 43.9,12.4 44)))")
|
||||
self.assertTrue(
|
||||
@@ -600,7 +605,8 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
||||
)
|
||||
)
|
||||
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.05, 0.23)) FROM "geoapp_country"
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.05, 0.23))
|
||||
# FROM "geoapp_country"
|
||||
# WHERE "geoapp_country"."name" = 'San Marino';
|
||||
ref = fromstr(
|
||||
"MULTIPOLYGON(((12.4 43.93,12.45 43.93,12.5 43.93,12.45 43.93,12.4 43.93)))"
|
||||
@@ -614,10 +620,12 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
||||
)
|
||||
)
|
||||
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.5, 0.17, 0.05, 0.23)) FROM "geoapp_country"
|
||||
# SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.5, 0.17, 0.05, 0.23))
|
||||
# FROM "geoapp_country"
|
||||
# WHERE "geoapp_country"."name" = 'San Marino';
|
||||
ref = fromstr(
|
||||
"MULTIPOLYGON(((12.4 43.87,12.45 43.87,12.45 44.1,12.5 44.1,12.5 43.87,12.45 43.87,12.4 43.87)))"
|
||||
"MULTIPOLYGON(((12.4 43.87,12.45 43.87,12.45 44.1,12.5 44.1,12.5 43.87,"
|
||||
"12.45 43.87,12.4 43.87)))"
|
||||
)
|
||||
self.assertTrue(
|
||||
ref.equals_exact(
|
||||
|
||||
@@ -301,8 +301,8 @@ class GeoLookupTest(TestCase):
|
||||
ks = State.objects.get(poly__contains=lawrence.point)
|
||||
self.assertEqual("Kansas", ks.name)
|
||||
|
||||
# Pueblo and Oklahoma City (even though OK City is within the bounding box of Texas)
|
||||
# are not contained in Texas or New Zealand.
|
||||
# Pueblo and Oklahoma City (even though OK City is within the bounding
|
||||
# box of Texas) are not contained in Texas or New Zealand.
|
||||
self.assertEqual(
|
||||
len(Country.objects.filter(mpoly__contains=pueblo.point)), 0
|
||||
) # Query w/GEOSGeometry object
|
||||
@@ -597,8 +597,10 @@ class GeoQuerySetTest(TestCase):
|
||||
Testing the `Extent` aggregate.
|
||||
"""
|
||||
# Reference query:
|
||||
# `SELECT ST_extent(point) FROM geoapp_city WHERE (name='Houston' or name='Dallas');`
|
||||
# => BOX(-96.8016128540039 29.7633724212646,-95.3631439208984 32.7820587158203)
|
||||
# SELECT ST_extent(point)
|
||||
# FROM geoapp_city
|
||||
# WHERE (name='Houston' or name='Dallas');`
|
||||
# => BOX(-96.8016128540039 29.7633724212646,-95.3631439208984 32.7820587158203)
|
||||
expected = (
|
||||
-96.8016128540039,
|
||||
29.7633724212646,
|
||||
|
||||
Reference in New Issue
Block a user