diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py index 56b8b66023..cd18868ddc 100644 --- a/django/contrib/admin/tests.py +++ b/django/contrib/admin/tests.py @@ -54,7 +54,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): def wait_for(self, css_selector, timeout=10): """ - Helper function that blocks until an css selector is found on the page. + Helper function that blocks until a CSS selector is found on the page. """ from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ec @@ -65,7 +65,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): def wait_for_text(self, css_selector, text, timeout=10): """ - Helper function that blocks until the text is found in the css selector. + Helper function that blocks until the text is found in the CSS selector. """ from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ec @@ -77,7 +77,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): def wait_for_value(self, css_selector, text, timeout=10): """ - Helper function that blocks until the value is found in the css selector. + Helper function that blocks until the value is found in the CSS selector. """ from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ec @@ -96,7 +96,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): # Wait for the next page to be loaded self.wait_loaded_tag('body') except TimeoutException: - # IE7 occasionnally returns an error "Internet Explorer cannot + # IE7 occasionally returns an error "Internet Explorer cannot # display the webpage" and doesn't load the next page. We just # ignore it. pass diff --git a/django/contrib/admin/utils.py b/django/contrib/admin/utils.py index d614e44cb8..91a7eb248c 100644 --- a/django/contrib/admin/utils.py +++ b/django/contrib/admin/utils.py @@ -108,7 +108,7 @@ def flatten_fieldsets(fieldsets): def get_deleted_objects(objs, opts, user, admin_site, using): """ Find all objects related to ``objs`` that should also be deleted. ``objs`` - must be a homogenous iterable of objects (e.g. a QuerySet). + must be a homogeneous iterable of objects (e.g. a QuerySet). Returns a nested list of strings suitable for display in the template with the ``unordered_list`` filter. diff --git a/django/contrib/auth/decorators.py b/django/contrib/auth/decorators.py index 6a976b48dc..12a79c0918 100644 --- a/django/contrib/auth/decorators.py +++ b/django/contrib/auth/decorators.py @@ -56,7 +56,7 @@ def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login def permission_required(perm, login_url=None, raise_exception=False): """ Decorator for views that checks whether a user has a particular permission - enabled, redirecting to the log-in page if neccesary. + enabled, redirecting to the log-in page if necessary. If the raise_exception parameter is given the PermissionDenied exception is raised. """ diff --git a/django/contrib/auth/hashers.py b/django/contrib/auth/hashers.py index 992e19e2a4..4e40a7c2ba 100644 --- a/django/contrib/auth/hashers.py +++ b/django/contrib/auth/hashers.py @@ -186,7 +186,7 @@ class BasePasswordHasher(object): def salt(self): """ - Generates a cryptographically secure nonce salt in ascii + Generates a cryptographically secure nonce salt in ASCII """ return get_random_string() diff --git a/django/contrib/auth/tests/test_management.py b/django/contrib/auth/tests/test_management.py index f0dc66baa3..c78142722f 100644 --- a/django/contrib/auth/tests/test_management.py +++ b/django/contrib/auth/tests/test_management.py @@ -39,7 +39,7 @@ def mock_inputs(inputs): def mock_input(prompt): # prompt should be encoded in Python 2. This line will raise an - # Exception if prompt contains unencoded non-ascii on Python 2. + # Exception if prompt contains unencoded non-ASCII on Python 2. prompt = str(prompt) assert str('__proxy__') not in prompt response = '' diff --git a/django/contrib/comments/views/moderation.py b/django/contrib/comments/views/moderation.py index 24ba42fb04..3bf70f321c 100644 --- a/django/contrib/comments/views/moderation.py +++ b/django/contrib/comments/views/moderation.py @@ -90,7 +90,7 @@ def approve(request, comment_id, next=None): template.RequestContext(request) ) -# The following functions actually perform the various flag/aprove/delete +# The following functions actually perform the various flag/approve/delete # actions. They've been broken out into separate functions to that they # may be called from admin actions. diff --git a/django/contrib/flatpages/tests/test_csrf.py b/django/contrib/flatpages/tests/test_csrf.py index 23c03a1e13..9ec12a7695 100644 --- a/django/contrib/flatpages/tests/test_csrf.py +++ b/django/contrib/flatpages/tests/test_csrf.py @@ -51,13 +51,13 @@ class FlatpageCSRFTests(TestCase): self.assertContains(response, "
Isn't it sekrit!
") def test_fallback_flatpage(self): - "A flatpage can be served by the fallback middlware" + "A flatpage can be served by the fallback middleware" response = self.client.get('/flatpage/') self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_fallback_non_existent_flatpage(self): - "A non-existent flatpage raises a 404 when served by the fallback middlware" + "A non-existent flatpage raises a 404 when served by the fallback middleware" response = self.client.get('/no_such_flatpage/') self.assertEqual(response.status_code, 404) diff --git a/django/contrib/flatpages/tests/test_middleware.py b/django/contrib/flatpages/tests/test_middleware.py index 47d29bdb00..6dd1f6b3b3 100644 --- a/django/contrib/flatpages/tests/test_middleware.py +++ b/django/contrib/flatpages/tests/test_middleware.py @@ -48,13 +48,13 @@ class FlatpageMiddlewareTests(TestCase): self.assertContains(response, "Isn't it sekrit!
") def test_fallback_flatpage(self): - "A flatpage can be served by the fallback middlware" + "A flatpage can be served by the fallback middleware" response = self.client.get('/flatpage/') self.assertEqual(response.status_code, 200) self.assertContains(response, "Isn't it flat!
") def test_fallback_non_existent_flatpage(self): - "A non-existent flatpage raises a 404 when served by the fallback middlware" + "A non-existent flatpage raises a 404 when served by the fallback middleware" response = self.client.get('/no_such_flatpage/') self.assertEqual(response.status_code, 404) @@ -116,12 +116,12 @@ class FlatpageMiddlewareAppendSlashTests(TestCase): self.assertEqual(response.status_code, 404) def test_redirect_fallback_flatpage(self): - "A flatpage can be served by the fallback middlware and should add a slash" + "A flatpage can be served by the fallback middleware and should add a slash" response = self.client.get('/flatpage') self.assertRedirects(response, '/flatpage/', status_code=301) def test_redirect_fallback_non_existent_flatpage(self): - "A non-existent flatpage raises a 404 when served by the fallback middlware and should not add a slash" + "A non-existent flatpage raises a 404 when served by the fallback middleware and should not add a slash" response = self.client.get('/no_such_flatpage') self.assertEqual(response.status_code, 404) diff --git a/django/contrib/flatpages/tests/test_templatetags.py b/django/contrib/flatpages/tests/test_templatetags.py index 025c73c2cf..25aacf1802 100644 --- a/django/contrib/flatpages/tests/test_templatetags.py +++ b/django/contrib/flatpages/tests/test_templatetags.py @@ -88,7 +88,7 @@ class FlatpageTemplateTagTests(TestCase): @skipIfCustomUser def test_get_flatpages_with_prefix_for_user(self): - "The flatpage template tag retrive prefixed flatpages for an authenticated user" + "The flatpage template tag retrieve prefixed flatpages for an authenticated user" me = User.objects.create_user('testuser', 'test@example.com', 's3krit') out = Template( "{% load flatpages %}" diff --git a/django/contrib/flatpages/tests/test_views.py b/django/contrib/flatpages/tests/test_views.py index d2683fbbf4..6e8b5f4fab 100644 --- a/django/contrib/flatpages/tests/test_views.py +++ b/django/contrib/flatpages/tests/test_views.py @@ -53,7 +53,7 @@ class FlatpageViewTests(TestCase): self.assertEqual(response.status_code, 404) def test_fallback_non_existent_flatpage(self): - "A non-existent flatpage won't be served if the fallback middlware is disabled" + "A non-existent flatpage won't be served if the fallback middleware is disabled" response = self.client.get('/no_such_flatpage/') self.assertEqual(response.status_code, 404) @@ -109,7 +109,7 @@ class FlatpageViewAppendSlashTests(TestCase): self.assertEqual(response.status_code, 404) def test_redirect_fallback_non_existent_flatpage(self): - "A non-existent flatpage won't be served if the fallback middlware is disabled and should not add a slash" + "A non-existent flatpage won't be served if the fallback middleware is disabled and should not add a slash" response = self.client.get('/no_such_flatpage') self.assertEqual(response.status_code, 404) diff --git a/django/contrib/formtools/tests/tests.py b/django/contrib/formtools/tests/tests.py index 59939a1ecd..870f45abb0 100644 --- a/django/contrib/formtools/tests/tests.py +++ b/django/contrib/formtools/tests/tests.py @@ -58,7 +58,7 @@ class PreviewTests(TestCase): """ Test contrib.formtools.preview form retrieval. - Use the client library to see if we can sucessfully retrieve + Use the client library to see if we can successfully retrieve the form (mostly testing the setup ROOT_URLCONF process). Verify that an additional hidden input field is created to manage the stage. diff --git a/django/contrib/formtools/wizard/views.py b/django/contrib/formtools/wizard/views.py index f5cf563ad5..1b297838be 100644 --- a/django/contrib/formtools/wizard/views.py +++ b/django/contrib/formtools/wizard/views.py @@ -368,7 +368,7 @@ class WizardView(TemplateView): def get_form_initial(self, step): """ Returns a dictionary which will be passed to the form for `step` - as `initial`. If no initial data was provied while initializing the + as `initial`. If no initial data was provided while initializing the form wizard, a empty dictionary will be returned. """ return self.initial_dict.get(step, {}) @@ -376,7 +376,7 @@ class WizardView(TemplateView): def get_form_instance(self, step): """ Returns a object which will be passed to the form for `step` - as `instance`. If no instance object was provied while initializing + as `instance`. If no instance object was provided while initializing the form wizard, None will be returned. """ return self.instance_dict.get(step, None) diff --git a/django/contrib/gis/db/backends/base.py b/django/contrib/gis/db/backends/base.py index 4da0af0d27..73300ba997 100644 --- a/django/contrib/gis/db/backends/base.py +++ b/django/contrib/gis/db/backends/base.py @@ -148,7 +148,7 @@ class BaseSpatialOperations(object): class SpatialRefSysMixin(object): """ The SpatialRefSysMixin is a class used by the database-dependent - SpatialRefSys objects to reduce redundnant code. + SpatialRefSys objects to reduce redundant code. """ # For pulling out the spheroid from the spatial reference string. This # regular expression is used only if the user does not have GDAL installed. @@ -304,7 +304,7 @@ class SpatialRefSysMixin(object): def get_units(cls, wkt): """ Class method used by GeometryField on initialization to - retrive the units on the given WKT, without having to use + retrieve the units on the given WKT, without having to use any of the database fields. """ if gdal.HAS_GDAL: diff --git a/django/contrib/gis/db/backends/oracle/operations.py b/django/contrib/gis/db/backends/oracle/operations.py index b3aa191ccc..72ac381612 100644 --- a/django/contrib/gis/db/backends/oracle/operations.py +++ b/django/contrib/gis/db/backends/oracle/operations.py @@ -196,7 +196,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations): else: dist_param = value - # dwithin lookups on oracle require a special string parameter + # dwithin lookups on Oracle require a special string parameter # that starts with "distance=". if lookup_type == 'dwithin': dist_param = 'distance=%s' % dist_param @@ -220,7 +220,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations): placeholder = '%s(%%s, %s)' % (self.transform, f.srid) else: placeholder = '%s' - # No geometry value used for F expression, substitue in + # No geometry value used for F expression, substitute in # the column name instead. return placeholder % self.get_expression_column(value) else: diff --git a/django/contrib/gis/db/backends/postgis/introspection.py b/django/contrib/gis/db/backends/postgis/introspection.py index 8edc13387d..412014bf44 100644 --- a/django/contrib/gis/db/backends/postgis/introspection.py +++ b/django/contrib/gis/db/backends/postgis/introspection.py @@ -51,7 +51,7 @@ class PostGISIntrospection(DatabaseIntrospection): if not self.postgis_types_reverse: # If the PostGIS types reverse dictionary is not populated, do so # now. In order to prevent unnecessary requests upon connection - # intialization, the `data_types_reverse` dictionary is not updated + # initialization, the `data_types_reverse` dictionary is not updated # with the PostGIS custom types until introspection is actually # performed -- in other words, when this function is called. self.postgis_types_reverse = self.get_postgis_types() diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py index e8da6a52a6..9cc5b3f683 100644 --- a/django/contrib/gis/db/backends/postgis/operations.py +++ b/django/contrib/gis/db/backends/postgis/operations.py @@ -290,7 +290,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): def convert_extent3d(self, box3d): """ Returns a 6-tuple extent for the `Extent3D` aggregate by converting - the 3d bounding-box text returnded by PostGIS (`box3d` argument), for + the 3d bounding-box text returned by PostGIS (`box3d` argument), for example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)". """ ll, ur = box3d[6:-1].split(',') @@ -342,7 +342,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): This is the most complex implementation of the spatial backends due to what is supported on geodetic geometry columns vs. what's available on projected geometry columns. In addition, it has to take into account - the newly introduced geography column type introudced in PostGIS 1.5. + the geography column type newly introduced in PostGIS 1.5. """ # Getting the distance parameter and any options. if len(dist_val) == 1: @@ -561,7 +561,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations): """ agg_name = agg.__class__.__name__ if not self.check_aggregate_support(agg): - raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name) + raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name) agg_name = agg_name.lower() if agg_name == 'union': agg_name += 'agg' diff --git a/django/contrib/gis/db/backends/spatialite/creation.py b/django/contrib/gis/db/backends/spatialite/creation.py index 06f105d563..8cadef9f9c 100644 --- a/django/contrib/gis/db/backends/spatialite/creation.py +++ b/django/contrib/gis/db/backends/spatialite/creation.py @@ -116,7 +116,7 @@ class SpatiaLiteCreation(DatabaseCreation): def spatialite_init_file(self): # SPATIALITE_SQL may be placed in settings to tell GeoDjango - # to use a specific path to the SpatiaLite initilization SQL. + # to use a specific path to the SpatiaLite initialization SQL. return getattr(settings, 'SPATIALITE_SQL', 'init_spatialite-%s.%s.sql' % self.connection.ops.spatial_version[:2]) diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py index ad44b470b3..718add0618 100644 --- a/django/contrib/gis/db/backends/spatialite/operations.py +++ b/django/contrib/gis/db/backends/spatialite/operations.py @@ -233,7 +233,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): placeholder = '%s(%%s, %s)' % (self.transform, f.srid) else: placeholder = '%s' - # No geometry value used for F expression, substitue in + # No geometry value used for F expression, substitute in # the column name instead. return placeholder % self.get_expression_column(value) else: @@ -310,7 +310,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): """ agg_name = agg.__class__.__name__ if not self.check_aggregate_support(agg): - raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name) + raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name) agg_name = agg_name.lower() if agg_name == 'union': agg_name += 'agg' diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py index b368f425be..3d0c2beec7 100644 --- a/django/contrib/gis/db/models/query.py +++ b/django/contrib/gis/db/models/query.py @@ -73,7 +73,7 @@ class GeoQuerySet(QuerySet): def collect(self, **kwargs): """ Performs an aggregate collect operation on the given geometry field. - This is analagous to a union operation, but much faster because + This is analogous to a union operation, but much faster because boundaries are not dissolved. """ return self._spatial_aggregate(aggregates.Collect, **kwargs) @@ -137,7 +137,7 @@ class GeoQuerySet(QuerySet): def geojson(self, precision=8, crs=False, bbox=False, **kwargs): """ - Returns a GeoJSON representation of the geomtry field in a `geojson` + Returns a GeoJSON representation of the geometry field in a `geojson` attribute on each element of the GeoQuerySet. The `crs` and `bbox` keywords may be set to True if the user wants diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py index b81c8a42a7..398d702d71 100644 --- a/django/contrib/gis/db/models/sql/compiler.py +++ b/django/contrib/gis/db/models/sql/compiler.py @@ -21,7 +21,7 @@ class GeoSQLCompiler(compiler.SQLCompiler): If 'with_aliases' is true, any column names that are duplicated (without the table names) are given unique aliases. This is needed in - some cases to avoid ambiguitity with nested queries. + some cases to avoid ambiguity with nested queries. This routine is overridden from Query to handle customized selection of geometry columns. diff --git a/django/contrib/gis/feeds.py b/django/contrib/gis/feeds.py index 7e7b872df6..f77a2eae0f 100644 --- a/django/contrib/gis/feeds.py +++ b/django/contrib/gis/feeds.py @@ -21,7 +21,7 @@ class GeoFeedMixin(object): def add_georss_point(self, handler, coords, w3c_geo=False): """ Adds a GeoRSS point with the given coords using the given handler. - Handles the differences between simple GeoRSS and the more pouplar + Handles the differences between simple GeoRSS and the more popular W3C Geo specification. """ if w3c_geo: diff --git a/django/contrib/gis/gdal/prototypes/errcheck.py b/django/contrib/gis/gdal/prototypes/errcheck.py index 491641646e..72231188c8 100644 --- a/django/contrib/gis/gdal/prototypes/errcheck.py +++ b/django/contrib/gis/gdal/prototypes/errcheck.py @@ -12,7 +12,7 @@ from django.utils import six # Helper routines for retrieving pointers and/or values from # arguments passed in by reference. def arg_byref(args, offset=-1): - "Returns the pointer argument's by-refernece value." + "Returns the pointer argument's by-reference value." return args[offset]._obj.value @@ -56,8 +56,8 @@ def check_string(result, func, cargs, offset=-1, str_result=False): ptr = ptr_byref(cargs, offset) # Getting the string value s = ptr.value - # Correctly freeing the allocated memory beind GDAL pointer - # w/the VSIFree routine. + # Correctly freeing the allocated memory behind GDAL pointer + # with the VSIFree routine. if ptr: lgdal.VSIFree(ptr) return s @@ -131,7 +131,7 @@ def check_str_arg(result, func, cargs): """ This is for the OSRGet[Angular|Linear]Units functions, which require that the returned string pointer not be freed. This - returns both the double and tring values. + returns both the double and string values. """ dbl = result ptr = cargs[-1]._obj diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py index 2c05bfb943..65989f5c89 100644 --- a/django/contrib/gis/gdal/srs.py +++ b/django/contrib/gis/gdal/srs.py @@ -120,7 +120,7 @@ class SpatialReference(GDALBase): 0 >>> print(srs['UNIT|AUTHORITY']) # For the units authority, have to use the pipe symbole. EPSG - >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the untis + >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units 9122 """ if isinstance(target, tuple): diff --git a/django/contrib/gis/gdal/tests/test_envelope.py b/django/contrib/gis/gdal/tests/test_envelope.py index 555ca69531..c79a8e54da 100644 --- a/django/contrib/gis/gdal/tests/test_envelope.py +++ b/django/contrib/gis/gdal/tests/test_envelope.py @@ -20,7 +20,7 @@ class EnvelopeTest(unittest.TestCase): self.e = Envelope(0, 0, 5, 5) def test01_init(self): - "Testing Envelope initilization." + "Testing Envelope initialization." e1 = Envelope((0, 0, 5, 5)) Envelope(0, 0, 5, 5) Envelope(0, '0', '5', 5) # Thanks to ww for this diff --git a/django/contrib/gis/gdal/tests/test_geom.py b/django/contrib/gis/gdal/tests/test_geom.py index ed6bb2ad9c..bf028d19db 100644 --- a/django/contrib/gis/gdal/tests/test_geom.py +++ b/django/contrib/gis/gdal/tests/test_geom.py @@ -300,7 +300,7 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin): self.assertEqual(4269, mpoly.srid) self.assertEqual('NAD83', mpoly.srs.name) - # Incrementing through the multipolyogn after the spatial reference + # Incrementing through the multipolygon after the spatial reference # has been re-assigned. for poly in mpoly: self.assertEqual(mpoly.srs.wkt, poly.srs.wkt) diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py index 5e3b39347a..608cb5e65f 100644 --- a/django/contrib/gis/geoip/base.py +++ b/django/contrib/gis/geoip/base.py @@ -192,7 +192,7 @@ class GeoIP(object): def country(self, query): """ - Returns a dictonary with with the country code and name when given an + Returns a dictionary with with the country code and name when given an IP address or a Fully Qualified Domain Name (FQDN). For example, both '24.124.1.80' and 'djangoproject.com' are valid parameters. """ diff --git a/django/contrib/gis/geoip/prototypes.py b/django/contrib/gis/geoip/prototypes.py index 8d78386584..8ddcb9d974 100644 --- a/django/contrib/gis/geoip/prototypes.py +++ b/django/contrib/gis/geoip/prototypes.py @@ -56,7 +56,7 @@ GeoIPRecord_delete.restype = None def check_record(result, func, cargs): if result: # Checking the pointer to the C structure, if valid pull out elements - # into a dicionary. + # into a dictionary. rec = result.contents record = dict((fld, getattr(rec, fld)) for fld, ctype in rec._fields_) diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py index f453f113f7..244e301a3f 100644 --- a/django/contrib/gis/geos/geometry.py +++ b/django/contrib/gis/geos/geometry.py @@ -78,7 +78,7 @@ class GEOSGeometry(GEOSBase, ListMixin): else: raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.') elif isinstance(geo_input, GEOM_PTR): - # When the input is a pointer to a geomtry (GEOM_PTR). + # When the input is a pointer to a geometry (GEOM_PTR). g = geo_input elif isinstance(geo_input, memoryview): # When the input is a buffer (WKB). @@ -682,7 +682,7 @@ class GEOSGeometry(GEOSBase, ListMixin): def length(self): """ Returns the length of this Geometry (e.g., 0 for point, or the - circumfrence of a Polygon). + circumference of a Polygon). """ return capi.geos_length(self.ptr, byref(c_double())) diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py index 5be05cee50..b6c5c6f587 100644 --- a/django/contrib/gis/geos/libgeos.py +++ b/django/contrib/gis/geos/libgeos.py @@ -38,7 +38,7 @@ else: raise ImportError('Unsupported OS "%s"' % os.name) # Using the ctypes `find_library` utility to find the path to the GEOS -# shared library. This is better than manually specifiying each library name +# shared library. This is better than manually specifying each library name # and extension (e.g., libgeos_c.[so|so.1|dylib].). if lib_names: for lib_name in lib_names: @@ -121,7 +121,7 @@ def get_pointer_arr(n): return GeomArr() # Returns the string version of the GEOS library. Have to set the restype -# explicitly to c_char_p to ensure compatibility accross 32 and 64-bit platforms. +# explicitly to c_char_p to ensure compatibility across 32 and 64-bit platforms. geos_version = lgeos.GEOSversion geos_version.argtypes = None geos_version.restype = c_char_p diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py index 4c38c9bfcb..3d666947e4 100644 --- a/django/contrib/gis/geos/tests/test_geos.py +++ b/django/contrib/gis/geos/tests/test_geos.py @@ -68,7 +68,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): # Because pointers have been set to NULL, an exception should be # raised when we try to access it. Raising an exception is - # preferrable to a segmentation fault that commonly occurs when + # preferable to a segmentation fault that commonly occurs when # a C method is given a NULL memory reference. for fg in (fg1, fg2): # Equivalent to `fg.ptr` @@ -167,7 +167,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): "Testing creation from HEX." for g in self.geometries.hex_wkt: geom_h = GEOSGeometry(g.hex) - # we need to do this so decimal places get normalised + # we need to do this so decimal places get normalized geom_t = fromstr(g.wkt) self.assertEqual(geom_t.wkt, geom_h.wkt) @@ -176,7 +176,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): for g in self.geometries.hex_wkt: wkb = memoryview(a2b_hex(g.hex.encode())) geom_h = GEOSGeometry(wkb) - # we need to do this so decimal places get normalised + # we need to do this so decimal places get normalized geom_t = fromstr(g.wkt) self.assertEqual(geom_t.wkt, geom_h.wkt) @@ -788,7 +788,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): ls = LineString((0, 0), (1, 1)) self.assertAlmostEqual(1.41421356237, ls.length, 11) - # Should be circumfrence of Polygon + # Should be circumference of Polygon poly = Polygon(LinearRing((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))) self.assertEqual(4.0, poly.length) diff --git a/django/contrib/gis/maps/google/overlays.py b/django/contrib/gis/maps/google/overlays.py index e7e563e199..d9ba31380a 100644 --- a/django/contrib/gis/maps/google/overlays.py +++ b/django/contrib/gis/maps/google/overlays.py @@ -158,7 +158,7 @@ class GPolyline(GOverlayBase): opacity: The opacity of the polyline, between 0 and 1. Defaults to 1. """ - # If a GEOS geometry isn't passed in, try to contsruct one. + # If a GEOS geometry isn't passed in, try to construct one. if isinstance(geom, six.string_types): geom = fromstr(geom) if isinstance(geom, (tuple, list)): diff --git a/django/contrib/gis/measure.py b/django/contrib/gis/measure.py index b8070c715a..456f1c7277 100644 --- a/django/contrib/gis/measure.py +++ b/django/contrib/gis/measure.py @@ -27,7 +27,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # """ -Distance and Area objects to allow for sensible and convienient calculation +Distance and Area objects to allow for sensible and convenient calculation and conversions. Authors: Robert Coup, Justin Bronn, Riccardo Di Virgilio diff --git a/django/contrib/gis/static/gis/js/OLMapWidget.js b/django/contrib/gis/static/gis/js/OLMapWidget.js index c14491e633..16e75f7b8f 100644 --- a/django/contrib/gis/static/gis/js/OLMapWidget.js +++ b/django/contrib/gis/static/gis/js/OLMapWidget.js @@ -22,7 +22,7 @@ OpenLayers.Util.properFeatures = function(features, geom_type) { /** * Class: OpenLayers.Format.DjangoWKT * Class for reading Well-Known Text, with workarounds to successfully parse - * geometries and collections as returnes by django.contrib.gis.geos. + * geometries and collections as returned by django.contrib.gis.geos. * * Inherits from: * -Callable in QuestionInline
') diff --git a/tests/admin_ordering/tests.py b/tests/admin_ordering/tests.py index acd1a5ccdb..7a6efb0b4d 100644 --- a/tests/admin_ordering/tests.py +++ b/tests/admin_ordering/tests.py @@ -58,7 +58,7 @@ class TestAdminOrdering(TestCase): def test_dynamic_ordering(self): """ - Let's use a custom ModelAdmin that changes the ordering dinamically. + Let's use a custom ModelAdmin that changes the ordering dynamically. """ super_user = User.objects.create(username='admin', is_superuser=True) other_user = User.objects.create(username='other') diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index af6aa92754..289f0bdd65 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals """ -A series of tests to establish that the command-line managment tools work as +A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ @@ -1474,7 +1474,7 @@ class CommandTypes(AdminScriptTestCase): def test_run_from_argv_non_ascii_error(self): """ - Test that non-ascii message of CommandError does not raise any + Test that non-ASCII message of CommandError does not raise any UnicodeDecodeError in run_from_argv. """ def raise_command_error(*args, **kwargs): diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 5e4edf6909..c39e99aa1b 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -249,7 +249,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase): def testChangeListSortingModel(self): """ Ensure we can sort on a list_display field that is a Model method - (colunn 3 is 'model_year' in ArticleAdmin) + (column 3 is 'model_year' in ArticleAdmin) """ response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'o': '-3'}) self.assertContentBefore(response, 'Newest content', 'Middle content', @@ -729,7 +729,7 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase): group = Group.objects.create(name="foogroup") post_data = { 'action': 'delete_selected', - 'selected_accross': '0', + 'selected_across': '0', 'index': '0', '_selected_action': group.id } @@ -1185,7 +1185,7 @@ class AdminViewPermissionsTest(TestCase): 'date_0': '2008-03-18', 'date_1': '10:54:39', 'section': 1} - # add user shoud not be able to view the list of article or change any of them + # add user should not be able to view the list of article or change any of them self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/') @@ -1259,7 +1259,7 @@ class AdminViewPermissionsTest(TestCase): login_url = reverse('admin:login') + '?next=/test_admin/admin/' - # add user shoud not be able to view the list of article or change any of them + # add user should not be able to view the list of article or change any of them self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/1/history/') @@ -1366,7 +1366,7 @@ class AdminViewPermissionsTest(TestCase): login_url = reverse('admin:login') + '?next=/test_admin/admin/' delete_dict = {'post': 'yes'} - # add user shoud not be able to delete articles + # add user should not be able to delete articles self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/1/delete/') @@ -1749,7 +1749,7 @@ class AdminViewStringPrimaryKeyTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SecureViewTests(TestCase): """ - Test behaviour of a view protected by the staff_member_required decorator. + Test behavior of a view protected by the staff_member_required decorator. """ urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] @@ -1782,7 +1782,7 @@ class AdminViewUnicodeTest(TestCase): def testUnicodeEdit(self): """ - A test to ensure that POST on edit_view handles non-ascii characters. + A test to ensure that POST on edit_view handles non-ASCII characters. """ post_data = { "name": "Test lærdommer", @@ -1815,7 +1815,7 @@ class AdminViewUnicodeTest(TestCase): def testUnicodeDelete(self): """ - Ensure that the delete_view handles non-ascii characters + Ensure that the delete_view handles non-ASCII characters """ delete_dict = {'post': 'yes'} response = self.client.get('/test_admin/admin/admin_views/book/1/delete/') @@ -3995,7 +3995,7 @@ class CSSTest(TestCase): def testAppModelInFormBodyClass(self): """ - Ensure app and model tag are correcly read by change_form template + Ensure app and model tag are correctly read by change_form template """ response = self.client.get('/test_admin/admin/admin_views/section/add/') self.assertEqual(response.status_code, 200) @@ -4004,7 +4004,7 @@ class CSSTest(TestCase): def testAppModelInListBodyClass(self): """ - Ensure app and model tag are correcly read by change_list template + Ensure app and model tag are correctly read by change_list template """ response = self.client.get('/test_admin/admin/admin_views/section/') self.assertEqual(response.status_code, 200) @@ -4013,7 +4013,7 @@ class CSSTest(TestCase): def testAppModelInDeleteConfirmationBodyClass(self): """ - Ensure app and model tag are correcly read by delete_confirmation + Ensure app and model tag are correctly read by delete_confirmation template """ response = self.client.get( @@ -4024,7 +4024,7 @@ class CSSTest(TestCase): def testAppModelInAppIndexBodyClass(self): """ - Ensure app and model tag are correcly read by app_index template + Ensure app and model tag are correctly read by app_index template """ response = self.client.get('/test_admin/admin/admin_views/') self.assertEqual(response.status_code, 200) @@ -4032,7 +4032,7 @@ class CSSTest(TestCase): def testAppModelInDeleteSelectedConfirmationBodyClass(self): """ - Ensure app and model tag are correcly read by + Ensure app and model tag are correctly read by delete_selected_confirmation template """ action_data = { @@ -4719,7 +4719,7 @@ class AdminViewOnSiteTests(TestCase): ) def test_true(self): - "Ensure that the default behaviour is followed if view_on_site is True" + "Ensure that the default behavior is followed if view_on_site is True" response = self.client.get('/test_admin/admin/admin_views/city/1/') content_type_pk = ContentType.objects.get_for_model(City).pk self.assertContains(response, diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index dc3d3e2e46..9fce51059b 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -70,7 +70,7 @@ class AggregationTests(TestCase): Regression test for #11916: Extra params + aggregation creates incorrect SQL. """ - # oracle doesn't support subqueries in group by clause + # Oracle doesn't support subqueries in group by clause shortest_book_sql = """ SELECT name FROM aggregation_regress_book b @@ -1080,7 +1080,7 @@ class AggregationTests(TestCase): ) def test_name_expressions(self): - # Test that aggregates are spotted corretly from F objects. + # Test that aggregates are spotted correctly from F objects. # Note that Adrian's age is 34 in the fixtures, and he has one book # so both conditions match one author. qs = Author.objects.annotate(Count('book')).filter( diff --git a/tests/backends/tests.py b/tests/backends/tests.py index d5116898ec..eaded5dbae 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -563,14 +563,14 @@ class BackendTestCase(TestCase): @skipUnlessDBFeature('supports_paramstyle_pyformat') def test_cursor_execute_with_pyformat(self): - #10070: Support pyformat style passing of paramters + #10070: Support pyformat style passing of parameters args = {'root': 3, 'square': 9} self.create_squares(args, 'pyformat', multiple=False) self.assertEqual(models.Square.objects.count(), 1) @skipUnlessDBFeature('supports_paramstyle_pyformat') def test_cursor_executemany_with_pyformat(self): - #10070: Support pyformat style passing of paramters + #10070: Support pyformat style passing of parameters args = [{'root': i, 'square': i ** 2} for i in range(-5, 6)] self.create_squares(args, 'pyformat', multiple=True) self.assertEqual(models.Square.objects.count(), 11) @@ -733,7 +733,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 try: @@ -751,7 +751,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 try: @@ -768,7 +768,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 with connection.constraint_checks_disabled(): diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 976fb1124d..7b1f78a3b6 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -871,7 +871,7 @@ class SelectOnSaveTests(TestCase): with self.assertNumQueries(2): asos.save() self.assertTrue(FakeQuerySet.called) - # This is not wanted behaviour, but this is how Django has always + # This is not wanted behavior, but this is how Django has always # behaved for databases that do not return correct information # about matched rows for UPDATE. with self.assertRaises(DatabaseError): diff --git a/tests/cache/tests.py b/tests/cache/tests.py index f5d213e759..8c7fbc6d45 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -1292,7 +1292,7 @@ class CacheUtils(TestCase): def test_cache_key_varies_by_url(self): """ - get_cache_key keys differ by fully-qualfied URL instead of path + get_cache_key keys differ by fully-qualified URL instead of path """ request1 = self.factory.get(self.path, HTTP_HOST='sub-1.example.com') learn_cache_key(request1, HttpResponse()) diff --git a/tests/defer/tests.py b/tests/defer/tests.py index 266a851ffe..43a088f3e2 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -110,7 +110,7 @@ class DeferTests(TestCase): obj.name = "c2" obj.save() - # You can retrive a single column on a base class with no fields + # You can retrieve a single column on a base class with no fields obj = Child.objects.only("name").get(name="c2") self.assert_delayed(obj, 3) self.assertEqual(obj.name, "c2") diff --git a/tests/extra_regress/tests.py b/tests/extra_regress/tests.py index 4eaecc19af..8749cb8ebf 100644 --- a/tests/extra_regress/tests.py +++ b/tests/extra_regress/tests.py @@ -131,7 +131,7 @@ class ExtraRegressTests(TestCase): """ Regression test for #8039: Ordering sometimes removed relevant tables from extra(). This test is the critical case: ordering uses a table, - but then removes the reference because of an optimisation. The table + but then removes the reference because of an optimization. The table should still be present because of the extra() call. """ self.assertQuerysetEqual( diff --git a/tests/field_subclassing/fields.py b/tests/field_subclassing/fields.py index e9c7a982e8..43ece22e82 100644 --- a/tests/field_subclassing/fields.py +++ b/tests/field_subclassing/fields.py @@ -59,7 +59,7 @@ class SmallerField(SmallField): class JSONField(six.with_metaclass(models.SubfieldBase, models.TextField)): - description = ("JSONField automatically serializes and desializes values to " + description = ("JSONField automatically serializes and deserializes values to " "and from JSON.") def to_python(self, value): diff --git a/tests/field_subclassing/tests.py b/tests/field_subclassing/tests.py index 3045f7d226..6a3d1cad20 100644 --- a/tests/field_subclassing/tests.py +++ b/tests/field_subclassing/tests.py @@ -39,7 +39,7 @@ class CustomField(TestCase): # Custom fields still have normal field's attributes. self.assertEqual(m._meta.get_field("data").verbose_name, "small field") - # The m.data attribute has been initialised correctly. It's a Small + # The m.data attribute has been initialized correctly. It's a Small # object. self.assertEqual((m.data.first, m.data.second), (1, 2)) @@ -100,7 +100,7 @@ class CustomField(TestCase): http://users.rcn.com/python/download/Descriptor.htm#properties """ # Even when looking for totally different properties, SubfieldBase's - # non property like behaviour made inspect crash. Refs #12568. + # non property like behavior made inspect crash. Refs #12568. data = dict(inspect.getmembers(MyModel)) self.assertIn('__module__', data) self.assertEqual(data['__module__'], 'field_subclassing.models') diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index ae2076c5e4..4ffba851eb 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -341,7 +341,7 @@ class FileStorageTests(unittest.TestCase): def test_file_chunks_error(self): """ - Test behaviour when file.chunks() is raising an error + Test behavior when file.chunks() is raising an error """ f1 = ContentFile('chunks fails') diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py index a964ae79d7..88eadae6b9 100644 --- a/tests/fixtures/tests.py +++ b/tests/fixtures/tests.py @@ -304,7 +304,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): ]) def test_ambiguous_compressed_fixture(self): - # The name "fixture5" is ambigous, so loading it will raise an error + # The name "fixture5" is ambiguous, so loading it will raise an error with self.assertRaises(management.CommandError) as cm: management.call_command('loaddata', 'fixture5', verbosity=0) self.assertIn("Multiple fixtures named 'fixture5'", cm.exception.args[0]) diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 6984db30c6..61fc66d928 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -64,7 +64,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_not_ignore(self): """ Test for ticket #9279 -- Error is raised for entries in - the serialised data for fields that have been removed + the serialized data for fields that have been removed from the database when not ignored. """ with self.assertRaises(DeserializationError): @@ -77,7 +77,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_ignore(self): """ Test for ticket #9279 -- Ignores entries in - the serialised data for fields that have been removed + the serialized data for fields that have been removed from the database. """ management.call_command( @@ -90,7 +90,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_ignore_xml(self): """ - Test for ticket #19998 -- Ignore entries in the XML serialised data + Test for ticket #19998 -- Ignore entries in the XML serialized data for fields that have been removed from the model definition. """ management.call_command( diff --git a/tests/foreign_object/models.py b/tests/foreign_object/models.py index 5ec6f6d28b..fc51118149 100644 --- a/tests/foreign_object/models.py +++ b/tests/foreign_object/models.py @@ -113,7 +113,7 @@ class ArticleTranslationDescriptor(ReverseSingleRelatedObjectDescriptor): class ColConstraint(object): - # Antyhing with as_sql() method works in get_extra_restriction(). + # Anything with as_sql() method works in get_extra_restriction(). def __init__(self, alias, col, value): self.alias, self.col, self.value = alias, col, value diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index 100c655117..f74a6a08b2 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -510,7 +510,7 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin): self.assertFormErrors(['This is not a valid IPv6 address.'], f.clean, '1:2') def test_generic_ipaddress_normalization(self): - # Test the normalising code + # Test the normalizing code f = GenericIPAddressField() self.assertEqual(f.clean(' ::ffff:0a0a:0a0a '), '::ffff:10.10.10.10') self.assertEqual(f.clean(' ::ffff:10.10.10.10 '), '::ffff:10.10.10.10') diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index f06a31f393..c05c79a68e 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -1710,7 +1710,7 @@ class FormsTestCase(TestCase): def test_empty_permitted(self): # Sometimes (pretty much in formsets) we want to allow a form to pass validation # if it is completely empty. We can accomplish this by using the empty_permitted - # agrument to a form constructor. + # argument to a form constructor. class SongForm(Form): artist = CharField() name = CharField() diff --git a/tests/generic_views/urls.py b/tests/generic_views/urls.py index 8b2560b0f9..1ecc0ec898 100644 --- a/tests/generic_views/urls.py +++ b/tests/generic_views/urls.py @@ -164,7 +164,7 @@ urlpatterns = patterns('', views.AuthorListCustomPaginator.as_view()), # YearArchiveView - # Mixing keyword and possitional captures below is intentional; the views + # Mixing keyword and positional captures below is intentional; the views # ought to be able to accept either. (r'^dates/books/(?P