1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

Refs #36500 -- Rewrapped long docstrings and block comments via a script.

Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
This commit is contained in:
django-bot
2025-07-22 20:41:41 -07:00
committed by nessita
parent 55b0cc2131
commit 69a93a88ed
378 changed files with 2781 additions and 1861 deletions

View File

@@ -130,7 +130,8 @@ class LayerMapTest(TestCase):
self.assertEqual(Decimal(str(feat["Length"])), istate.length)
elif feat.fid == 1:
# Everything but the first two decimal digits were truncated,
# because the Interstate model's `length` field has decimal_places=2.
# because the Interstate model's `length` field has
# decimal_places=2.
self.assertAlmostEqual(feat.get("Length"), float(istate.length), 2)
for p1, p2 in zip(feat.geom, istate.path):
@@ -138,7 +139,9 @@ class LayerMapTest(TestCase):
self.assertAlmostEqual(p1[1], p2[1], 6)
def county_helper(self, county_feat=True):
"Helper function for ensuring the integrity of the mapped County models."
"""
Helper function for ensuring the integrity of the mapped County models.
"""
for name, n, st in zip(NAMES, NUMS, STATES):
# Should only be one record b/c of `unique` keyword.
c = County.objects.get(name=name)
@@ -157,10 +160,12 @@ class LayerMapTest(TestCase):
"""
# All the following should work.
# Telling LayerMapping that we want no transformations performed on the data.
# Telling LayerMapping that we want no transformations performed on the
# data.
lm = LayerMapping(County, co_shp, co_mapping, transform=False)
# Specifying the source spatial reference system via the `source_srs` keyword.
# Specifying the source spatial reference system via the `source_srs`
# keyword.
lm = LayerMapping(County, co_shp, co_mapping, source_srs=4269)
lm = LayerMapping(County, co_shp, co_mapping, source_srs="NAD83")
@@ -179,13 +184,14 @@ class LayerMapTest(TestCase):
with self.assertRaises(e):
LayerMapping(County, co_shp, co_mapping, transform=False, unique=arg)
# No source reference system defined in the shapefile, should raise an error.
# No source reference system defined in the shapefile, should raise an
# error.
if connection.features.supports_transform:
with self.assertRaises(LayerMapError):
LayerMapping(County, co_shp, co_mapping)
# Passing in invalid ForeignKey mapping parameters -- must be a dictionary
# mapping for the model the ForeignKey points to.
# Passing in invalid ForeignKey mapping parameters -- must be a
# dictionary mapping for the model the ForeignKey points to.
bad_fk_map1 = copy(co_mapping)
bad_fk_map1["state"] = "name"
bad_fk_map2 = copy(co_mapping)
@@ -195,9 +201,9 @@ class LayerMapTest(TestCase):
with self.assertRaises(LayerMapError):
LayerMapping(County, co_shp, bad_fk_map2, transform=False)
# There exist no State models for the ForeignKey mapping to work -- should raise
# a MissingForeignKey exception (this error would be ignored if the `strict`
# keyword is not set).
# There exist no State models for the ForeignKey mapping to work --
# should raise a MissingForeignKey exception (this error would be
# ignored if the `strict` keyword is not set).
lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique="name")
with self.assertRaises(MissingForeignKey):
lm.save(silent=True, strict=True)
@@ -208,12 +214,13 @@ class LayerMapTest(TestCase):
)
# If a mapping is specified as a collection, all OGR fields that
# are not collections will be converted into them. For example,
# a Point column would be converted to MultiPoint. Other things being done
# are not collections will be converted into them. For example, a Point
# column would be converted to MultiPoint. Other things being done
# w/the keyword args:
# `transform=False`: Specifies that no transform is to be done; this
# has the effect of ignoring the spatial reference check (because the
# county shapefile does not have implicit spatial reference info).
# has the effect of ignoring the spatial reference check (because
# the county shapefile does not have implicit spatial reference
# info).
#
# `unique='name'`: Creates models on the condition that they have
# unique county names; geometries from each feature however will be
@@ -223,8 +230,8 @@ class LayerMapTest(TestCase):
lm = LayerMapping(County, co_shp, co_mapping, transform=False, unique="name")
lm.save(silent=True, strict=True)
# A reference that doesn't use the unique keyword; a new database record will
# created for each polygon.
# A reference that doesn't use the unique keyword; a new database
# record will created for each polygon.
lm = LayerMapping(CountyFeat, co_shp, cofeat_mapping, transform=False)
lm.save(silent=True, strict=True)