From 2bcb8bfc8de5cd57ebb64b326cd7609aa0d8c1c7 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 26 Apr 2014 10:18:45 -0700 Subject: [PATCH] Fix many many typos in comments throughout the codebase --- django/contrib/admin/options.py | 2 +- django/contrib/auth/tests/test_decorators.py | 4 ++-- django/contrib/auth/tests/test_forms.py | 2 +- django/contrib/auth/tests/test_views.py | 2 +- django/contrib/formtools/tests/tests.py | 2 +- django/contrib/gis/db/backends/oracle/models.py | 8 ++++---- django/contrib/gis/db/backends/postgis/models.py | 8 ++++---- django/contrib/gis/db/backends/spatialite/models.py | 8 ++++---- .../contrib/gis/db/backends/spatialite/operations.py | 2 +- django/contrib/gis/db/models/query.py | 2 +- django/contrib/gis/db/models/sql/compiler.py | 2 +- django/contrib/gis/gdal/__init__.py | 2 +- django/contrib/gis/geoip/base.py | 2 +- django/contrib/gis/maps/google/__init__.py | 2 +- django/contrib/gis/maps/google/zoom.py | 2 +- django/contrib/gis/utils/layermapping.py | 2 +- django/contrib/messages/storage/cookie.py | 2 +- django/contrib/sessions/tests.py | 2 +- django/db/backends/__init__.py | 2 +- django/db/models/fields/files.py | 2 +- django/db/models/query.py | 10 +++++----- django/db/models/sql/compiler.py | 2 +- django/db/models/sql/datastructures.py | 2 +- django/db/models/sql/expressions.py | 4 ++-- django/db/models/sql/query.py | 8 ++++---- django/db/models/sql/where.py | 2 +- django/forms/fields.py | 2 +- django/http/request.py | 4 ++-- django/templatetags/i18n.py | 2 +- django/test/runner.py | 2 +- django/test/testcases.py | 3 +-- django/utils/archive.py | 2 +- django/utils/regex_helper.py | 2 +- django/views/generic/dates.py | 2 +- django/views/generic/detail.py | 2 +- tests/admin_checks/tests.py | 2 +- tests/admin_inlines/tests.py | 2 +- tests/admin_scripts/tests.py | 2 +- tests/admin_validation/tests.py | 4 ++-- tests/admin_views/admin.py | 2 +- tests/admin_views/tests.py | 6 +++--- tests/datatypes/tests.py | 2 +- tests/field_deconstruction/tests.py | 2 +- tests/file_uploads/tests.py | 4 ++-- tests/model_fields/models.py | 2 +- tests/model_forms/tests.py | 2 +- tests/model_inheritance_regress/tests.py | 6 +++--- tests/queries/tests.py | 2 +- tests/schema/tests.py | 2 +- tests/syndication_tests/tests.py | 2 +- tests/template_tests/test_response.py | 4 ++-- tests/template_tests/tests.py | 2 +- tests/validators/tests.py | 2 +- 53 files changed, 79 insertions(+), 80 deletions(-) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 4509da05ffc..016b73d9870 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -328,7 +328,7 @@ class BaseModelAdmin(six.with_metaclass(forms.MediaDefiningClass)): """ # We access the property and check if it triggers a warning. # If it does, then it's ours and we can safely ignore it, but if - # it doesn't then it has been overriden so we must warn about the + # it doesn't then it has been overridden so we must warn about the # deprecation. with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") diff --git a/django/contrib/auth/tests/test_decorators.py b/django/contrib/auth/tests/test_decorators.py index 7ee3499bbfc..c3ffbb4f4a1 100644 --- a/django/contrib/auth/tests/test_decorators.py +++ b/django/contrib/auth/tests/test_decorators.py @@ -89,7 +89,7 @@ class PermissionsRequiredDecoratorTest(TestCase): def test_permissioned_denied_redirect(self): - @permission_required(['auth.add_customuser', 'auth.change_customuser', 'non-existant-permission']) + @permission_required(['auth.add_customuser', 'auth.change_customuser', 'non-existent-permission']) def a_view(request): return HttpResponse() request = self.factory.get('/rand') @@ -99,7 +99,7 @@ class PermissionsRequiredDecoratorTest(TestCase): def test_permissioned_denied_exception_raised(self): - @permission_required(['auth.add_customuser', 'auth.change_customuser', 'non-existant-permission'], raise_exception=True) + @permission_required(['auth.add_customuser', 'auth.change_customuser', 'non-existent-permission'], raise_exception=True) def a_view(request): return HttpResponse() request = self.factory.get('/rand') diff --git a/django/contrib/auth/tests/test_forms.py b/django/contrib/auth/tests/test_forms.py index 837db709a57..0efd5fb8b52 100644 --- a/django/contrib/auth/tests/test_forms.py +++ b/django/contrib/auth/tests/test_forms.py @@ -388,7 +388,7 @@ class PasswordResetFormTest(TestCase): def test_nonexistant_email(self): """ - Test nonexistant email address. This should not fail because it would + Test nonexistent email address. This should not fail because it would expose information about registered users. """ data = {'email': 'foo@bar.com'} diff --git a/django/contrib/auth/tests/test_views.py b/django/contrib/auth/tests/test_views.py index 1f87c7ab799..a5be9ffff14 100644 --- a/django/contrib/auth/tests/test_views.py +++ b/django/contrib/auth/tests/test_views.py @@ -231,7 +231,7 @@ class PasswordResetTest(AuthViewsTestCase): self.assertContains(response, "The password reset link was invalid") def test_confirm_invalid_user(self): - # Ensure that we get a 200 response for a non-existant user, not a 404 + # Ensure that we get a 200 response for a non-existent user, not a 404 response = self.client.get('/reset/123456/1-1/') self.assertContains(response, "The password reset link was invalid") diff --git a/django/contrib/formtools/tests/tests.py b/django/contrib/formtools/tests/tests.py index 5d3b2747a72..eb8043e64e3 100644 --- a/django/contrib/formtools/tests/tests.py +++ b/django/contrib/formtools/tests/tests.py @@ -94,7 +94,7 @@ class PreviewTests(TestCase): Use the client library to POST to the form with stage set to 3 to see if our forms done() method is called. Check first without the security hash, verify failure, retry with security - hash and verify sucess. + hash and verify success. """ # Pass strings for form submittal and add stage variable to diff --git a/django/contrib/gis/db/backends/oracle/models.py b/django/contrib/gis/db/backends/oracle/models.py index c907b8280df..5fe5efc6128 100644 --- a/django/contrib/gis/db/backends/oracle/models.py +++ b/django/contrib/gis/db/backends/oracle/models.py @@ -27,16 +27,16 @@ class GeometryColumns(models.Model): @classmethod def table_name_col(cls): """ - Returns the name of the metadata column used to store the - the feature table name. + Returns the name of the metadata column used to store the feature table + name. """ return 'table_name' @classmethod def geom_col_name(cls): """ - Returns the name of the metadata column used to store the - the feature geometry column. + Returns the name of the metadata column used to store the feature + geometry column. """ return 'column_name' diff --git a/django/contrib/gis/db/backends/postgis/models.py b/django/contrib/gis/db/backends/postgis/models.py index 7f62eb1f489..4d4138a4dab 100644 --- a/django/contrib/gis/db/backends/postgis/models.py +++ b/django/contrib/gis/db/backends/postgis/models.py @@ -28,16 +28,16 @@ class GeometryColumns(models.Model): @classmethod def table_name_col(cls): """ - Returns the name of the metadata column used to store the - the feature table name. + Returns the name of the metadata column used to store the feature table + name. """ return 'f_table_name' @classmethod def geom_col_name(cls): """ - Returns the name of the metadata column used to store the - the feature geometry column. + Returns the name of the metadata column used to store the feature + geometry column. """ return 'f_geometry_column' diff --git a/django/contrib/gis/db/backends/spatialite/models.py b/django/contrib/gis/db/backends/spatialite/models.py index 551bc70ccd8..22721ee1c5f 100644 --- a/django/contrib/gis/db/backends/spatialite/models.py +++ b/django/contrib/gis/db/backends/spatialite/models.py @@ -25,16 +25,16 @@ class GeometryColumns(models.Model): @classmethod def table_name_col(cls): """ - Returns the name of the metadata column used to store the - the feature table name. + Returns the name of the metadata column used to store the feature table + name. """ return 'f_table_name' @classmethod def geom_col_name(cls): """ - Returns the name of the metadata column used to store the - the feature geometry column. + Returns the name of the metadata column used to store the feature + geometry column. """ return 'f_geometry_column' diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py index 718add06187..d3e260aaf9b 100644 --- a/django/contrib/gis/db/backends/spatialite/operations.py +++ b/django/contrib/gis/db/backends/spatialite/operations.py @@ -247,7 +247,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): """ Helper routine for calling SpatiaLite functions and returning their result. - Any error occuring in this method should be handled by the caller. + Any error occurring in this method should be handled by the caller. """ cursor = self.connection._cursor() try: diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py index 37935605fad..add67890e8e 100644 --- a/django/contrib/gis/db/models/query.py +++ b/django/contrib/gis/db/models/query.py @@ -38,7 +38,7 @@ class GeoQuerySet(QuerySet): Returns the area of the geographic field in an `area` attribute on each element of this GeoQuerySet. """ - # Peforming setup here rather than in `_spatial_attribute` so that + # Performing setup here rather than in `_spatial_attribute` so that # we can get the units for `AreaField`. procedure_args, geo_field = self._spatial_setup('area', field_name=kwargs.get('field_name', None)) s = {'procedure_args': procedure_args, diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py index dc559f7fb36..351a3171b0a 100644 --- a/django/contrib/gis/db/models/sql/compiler.py +++ b/django/contrib/gis/db/models/sql/compiler.py @@ -314,7 +314,7 @@ class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, GeoSQLCompiler): datetime = self.resolve_columns(row, fields)[offset] elif needs_string_cast: datetime = typecast_timestamp(str(datetime)) - # Datetimes are artifically returned in UTC on databases that + # Datetimes are artificially returned in UTC on databases that # don't support time zone. Restore the zone used in the query. if settings.USE_TZ: datetime = datetime.replace(tzinfo=None) diff --git a/django/contrib/gis/gdal/__init__.py b/django/contrib/gis/gdal/__init__.py index 659ac7f042a..02c78add012 100644 --- a/django/contrib/gis/gdal/__init__.py +++ b/django/contrib/gis/gdal/__init__.py @@ -28,7 +28,7 @@ GDAL links to a large number of external libraries that consume RAM when loaded. Thus, it may desirable to disable GDAL on systems with limited RAM resources -- this may be accomplished by setting `GDAL_LIBRARY_PATH` - to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; + to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; setting to None/False/'' will not work as a string must be given). """ from django.contrib.gis.gdal.error import check_err, OGRException, OGRIndexError, SRSException # NOQA diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py index 608cb5e65fb..9295030c97e 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 dictionary with with the country code and name when given an + Returns a dictionary 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/maps/google/__init__.py b/django/contrib/gis/maps/google/__init__.py index 4f528f90c67..b70989100b4 100644 --- a/django/contrib/gis/maps/google/__init__.py +++ b/django/contrib/gis/maps/google/__init__.py @@ -50,7 +50,7 @@ - The `dom_id` property returns the DOM id for the map. Defaults to "map". The following attributes may be set or customized in your local settings: - * GOOGLE_MAPS_API_KEY: String of your Google Maps API key. These are tied to + * GOOGLE_MAPS_API_KEY: String of your Google Maps API key. These are tied to a domain. May be obtained from http://www.google.com/apis/maps/ * GOOGLE_MAPS_API_VERSION (optional): Defaults to using "2.x" * GOOGLE_MAPS_URL (optional): Must have a substitution ('%s') for the API diff --git a/django/contrib/gis/maps/google/zoom.py b/django/contrib/gis/maps/google/zoom.py index 937d5fe33cd..c4f1ad85d56 100644 --- a/django/contrib/gis/maps/google/zoom.py +++ b/django/contrib/gis/maps/google/zoom.py @@ -71,7 +71,7 @@ class GoogleZoom(object): npix = self._npix[zoom] # Calculating the pixel x coordinate by multiplying the longitude value - # with with the number of degrees/pixel at the given zoom level. + # with the number of degrees/pixel at the given zoom level. px_x = round(npix + (lon * self._degpp[zoom])) # Creating the factor, and ensuring that 1 or -1 is not passed in as the diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py index eda80697a4d..ead2f170ac3 100644 --- a/django/contrib/gis/utils/layermapping.py +++ b/django/contrib/gis/utils/layermapping.py @@ -97,7 +97,7 @@ class LayerMapping(object): self.mapping = mapping self.model = model - # Checking the layer -- intitialization of the object will fail if + # Checking the layer -- initialization of the object will fail if # things don't check out before hand. self.check_layer() diff --git a/django/contrib/messages/storage/cookie.py b/django/contrib/messages/storage/cookie.py index ca1ae7f6b67..b28fc783be0 100644 --- a/django/contrib/messages/storage/cookie.py +++ b/django/contrib/messages/storage/cookie.py @@ -103,7 +103,7 @@ class CookieStorage(BaseStorage): encoded_data = self._encode(messages) if self.max_cookie_size: # data is going to be stored eventually by SimpleCookie, which - # adds it's own overhead, which we must account for. + # adds its own overhead, which we must account for. cookie = SimpleCookie() # create outside the loop def stored_length(val): diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 34b89641539..8cda7ea05b4 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -493,7 +493,7 @@ class CacheSessionTests(SessionTestsMixin, unittest.TestCase): }, }, SESSION_CACHE_ALIAS='sessions') def test_non_default_cache(self): - # Re-initalize the session backend to make use of overridden settings. + # Re-initialize the session backend to make use of overridden settings. self.session = self.backend() self.session.save() diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index b0bb9ad9bd5..e9d644e5061 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -890,7 +890,7 @@ class BaseDatabaseOperations(object): if _allow_fallback: # Without sqlparse, fall back to the legacy (and buggy) logic. warnings.warn( - "Providing intial SQL data on a %s database will require " + "Providing initial SQL data on a %s database will require " "sqlparse in Django 1.9." % self.connection.vendor, RemovedInDjango19Warning) from django.core.management.sql import _split_statements diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py index 6cb49db24a7..518008b28d1 100644 --- a/django/db/models/fields/files.py +++ b/django/db/models/fields/files.py @@ -429,7 +429,7 @@ class ImageField(FileField): Dimensions can be forced to update with force=True, which is how ImageFileDescriptor.__set__ calls this method. """ - # Nothing to update if the field doesn't have have dimension fields. + # Nothing to update if the field doesn't have dimension fields. has_dimension_fields = self.width_field or self.height_field if not has_dimension_fields: return diff --git a/django/db/models/query.py b/django/db/models/query.py index a555e98c1a6..a1ff38e7840 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -757,8 +757,8 @@ class QuerySet(object): evaluated. When prefetch_related() is called more than once, the list of lookups to - prefetch is appended to. If prefetch_related(None) is called, the - the list is cleared. + prefetch is appended to. If prefetch_related(None) is called, the list + is cleared. """ clone = self._clone() if lookups == (None,): @@ -869,7 +869,7 @@ class QuerySet(object): def using(self, alias): """ - Selects which database this QuerySet should excecute its query against. + Selects which database this QuerySet should execute its query against. """ clone = self._clone() clone._db = alias @@ -1599,7 +1599,7 @@ class RawQuerySet(object): def using(self, alias): """ - Selects which database this Raw QuerySet should excecute it's query against. + Selects which database this Raw QuerySet should execute its query against. """ return RawQuerySet(self.raw_query, model=self.model, query=self.query.clone(using=alias), @@ -1621,7 +1621,7 @@ class RawQuerySet(object): index = self._columns.index(query_name) self._columns[index] = model_name except ValueError: - # Ignore translations for non-existant column names + # Ignore translations for non-existent column names pass return self._columns diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 9351169357c..09b1f7d4d8f 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -1132,7 +1132,7 @@ class SQLDateTimeCompiler(SQLCompiler): datetime = self.resolve_columns(row, fields)[offset] elif needs_string_cast: datetime = typecast_timestamp(str(datetime)) - # Datetimes are artifically returned in UTC on databases that + # Datetimes are artificially returned in UTC on databases that # don't support time zone. Restore the zone used in the query. if settings.USE_TZ: if datetime is None: diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index 634edf24772..f47e25208c2 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -1,5 +1,5 @@ """ -Useful auxilliary data structures for query construction. Not useful outside +Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ diff --git a/django/db/models/sql/expressions.py b/django/db/models/sql/expressions.py index e31eaa8a2f7..70646cfc619 100644 --- a/django/db/models/sql/expressions.py +++ b/django/db/models/sql/expressions.py @@ -40,7 +40,7 @@ class SQLEvaluator(object): return self.expression.evaluate(self, qn, connection) ##################################################### - # Vistor methods for initial expression preparation # + # Visitor methods for initial expression preparation # ##################################################### def prepare_node(self, node, query, allow_joins): @@ -72,7 +72,7 @@ class SQLEvaluator(object): [f.name for f in self.opts.fields])) ################################################## - # Vistor methods for final expression evaluation # + # Visitor methods for final expression evaluation # ################################################## def evaluate_node(self, node, qn, connection): diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 28003611ff7..92bfdb18819 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -199,7 +199,7 @@ class Query(object): def sql_with_params(self): """ Returns the query as an SQL string and the parameters that will be - subsituted into the query. + substituted into the query. """ return self.get_compiler(DEFAULT_DB_ALIAS).as_sql() @@ -675,7 +675,7 @@ class Query(object): alias = '%s%d' % (self.alias_prefix, len(self.alias_map) + 1) current.append(alias) else: - # The first occurence of a table uses the table name directly. + # The first occurrence of a table uses the table name directly. alias = table_name self.table_map[alias] = [alias] self.alias_refcount[alias] = 1 @@ -1242,7 +1242,7 @@ class Query(object): """ having_parts = [] for c in q_object.children[:]: - # When constucting the having nodes we need to take care to + # When constructing the having nodes we need to take care to # preserve the negation status from the upper parts of the tree if isinstance(c, Node): # For each negated child, flip the in_negated flag. @@ -1802,7 +1802,7 @@ class Query(object): """ If any fields are marked to be deferred, returns a dictionary mapping models to a set of names in those fields that will be loaded. If a - model is not in the returned dictionary, none of it's fields are + model is not in the returned dictionary, none of its fields are deferred. If no fields are marked for deferral, returns an empty dictionary. diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 0fedb771b74..f65e593a3a6 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -66,7 +66,7 @@ class WhereNode(tree.Node): # emptiness and transform any non-empty values correctly. value = list(value) - # The "value_annotation" parameter is used to pass auxilliary information + # The "value_annotation" parameter is used to pass auxiliary information # about the value(s) to the query construction. Specifically, datetime # and empty values need special handling. Other types could be used # here in the future (using Python types is suggested for consistency). diff --git a/django/forms/fields.py b/django/forms/fields.py index acff7a54a98..4fc5561c84c 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -187,7 +187,7 @@ class Field(object): Return True if data differs from initial. """ # For purposes of seeing whether something has changed, None is - # the same as an empty string, if the data or inital value we get + # the same as an empty string, if the data or initial value we get # is None, replace it w/ ''. initial_value = initial if initial is not None else '' try: diff --git a/django/http/request.py b/django/http/request.py index 4f272ec2c70..ded4744a871 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -231,11 +231,11 @@ class HttpRequest(object): try: self._post, self._files = self.parse_file_upload(self.META, data) except MultiPartParserError: - # An error occured while parsing POST data. Since when + # An error occurred while parsing POST data. Since when # formatting the error the request handler might access # self.POST, set self._post and self._file to prevent # attempts to parse POST data again. - # Mark that an error occured. This allows self.__repr__ to + # Mark that an error occurred. This allows self.__repr__ to # be explicit about it instead of simply representing an # empty POST self._mark_post_parse_error() diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index 984f122eacc..96560d80683 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -352,7 +352,7 @@ def do_translate(parser, token): def top(self): value = self.value() - # Backwards Compatiblity fix: + # Backwards Compatibility fix: # FilterExpression does not support single-quoted strings, # so we make a cheap localized fix in order to maintain # backwards compatibility with existing uses of ``trans`` diff --git a/django/test/runner.py b/django/test/runner.py index fcfdb07d9f5..5eafe354163 100644 --- a/django/test/runner.py +++ b/django/test/runner.py @@ -178,7 +178,7 @@ def dependency_ordered(test_databases, dependencies): # Maps db signature to dependencies of all it's aliases dependencies_map = {} - # sanity check - no DB can depend on it's own alias + # sanity check - no DB can depend on its own alias for sig, (_, aliases) in test_databases: all_deps = set() for alias in aliases: diff --git a/django/test/testcases.py b/django/test/testcases.py index 46237aecd2b..53ea93f4245 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -232,8 +232,7 @@ class SimpleTestCase(unittest.TestCase): def settings(self, **kwargs): """ - A context manager that temporarily sets a setting and reverts - back to the original value when exiting the context. + A context manager that temporarily sets a setting and reverts to the original value when exiting the context. """ return override_settings(**kwargs) diff --git a/django/utils/archive.py b/django/utils/archive.py index 3e5d22ae1b0..90b72593a97 100644 --- a/django/utils/archive.py +++ b/django/utils/archive.py @@ -141,7 +141,7 @@ class TarArchive(BaseArchive): self._archive.list(*args, **kwargs) def extract(self, to_path): - # note: python<=2.5 doesnt seem to know about pax headers, filter them + # note: python<=2.5 doesn't seem to know about pax headers, filter them members = [member for member in self._archive.getmembers() if member.name != 'pax_global_header'] leading = self.has_leading_dir(members) diff --git a/django/utils/regex_helper.py b/django/utils/regex_helper.py index 60a0e7acfa2..a43234ad05f 100644 --- a/django/utils/regex_helper.py +++ b/django/utils/regex_helper.py @@ -250,7 +250,7 @@ def get_quantifier(ch, input_iter): Parse a quantifier from the input, where "ch" is the first character in the quantifier. - Returns the minimum number of occurences permitted by the quantifier and + Returns the minimum number of occurrences permitted by the quantifier and either None or the next character from the input_iter if the next character is not part of the quantifier. """ diff --git a/django/views/generic/dates.py b/django/views/generic/dates.py index 2011c6f4be8..b80b7ffd185 100644 --- a/django/views/generic/dates.py +++ b/django/views/generic/dates.py @@ -698,7 +698,7 @@ def _get_next_prev(generic_view, date, is_previous, period): * If allow_empty and allow_future are both true, this is easy: just return the naive result (just the next/previous day/week/month, - reguardless of object existence.) + regardless of object existence.) * If allow_empty is true, allow_future is false, and the naive result isn't in the future, then return it; otherwise return None. diff --git a/django/views/generic/detail.py b/django/views/generic/detail.py index cbb8cf8fed1..d5f9186902b 100644 --- a/django/views/generic/detail.py +++ b/django/views/generic/detail.py @@ -60,7 +60,7 @@ class SingleObjectMixin(ContextMixin): Return the `QuerySet` that will be used to look up the object. Note that this method is called by the default implementation of - `get_object` and may not be called if `get_object` is overriden. + `get_object` and may not be called if `get_object` is overridden. """ if self.queryset is None: if self.model: diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py index 5008555556e..81f14afedd7 100644 --- a/tests/admin_checks/tests.py +++ b/tests/admin_checks/tests.py @@ -409,7 +409,7 @@ class SystemChecksTestCase(TestCase): def test_nonexistant_field(self): class SongAdmin(admin.ModelAdmin): - readonly_fields = ("title", "nonexistant") + readonly_fields = ("title", "nonexistent") errors = SongAdmin.check(model=Song) expected = [ diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 4b654c9f95c..ff34180a5bb 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -385,7 +385,7 @@ class TestInlinePermissions(TestCase): author = Author.objects.create(pk=1, name='The Author') book = author.books.create(name='The inline Book') self.author_change_url = '/admin/admin_inlines/author/%i/' % author.id - # Get the ID of the automatically created intermediate model for thw Author-Book m2m + # Get the ID of the automatically created intermediate model for the Author-Book m2m author_book_auto_m2m_intermediate = Author.books.through.objects.get(author=author, book=book) self.author_book_auto_m2m_intermediate_id = author_book_auto_m2m_intermediate.pk diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 43a1227ad82..4c3ee36b666 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -1564,7 +1564,7 @@ class Discovery(TestCase): def test_precedence(self): """ - Apps listed first in INSTALLED_APPS have precendence. + Apps listed first in INSTALLED_APPS have precedence. """ with self.settings(INSTALLED_APPS=['admin_scripts.complex_app', 'admin_scripts.simple_app', diff --git a/tests/admin_validation/tests.py b/tests/admin_validation/tests.py index 582f598d272..a7c32ca79f6 100644 --- a/tests/admin_validation/tests.py +++ b/tests/admin_validation/tests.py @@ -214,10 +214,10 @@ class ValidationTestCase(TestCase): def test_nonexistant_field(self): class SongAdmin(admin.ModelAdmin): - readonly_fields = ("title", "nonexistant") + readonly_fields = ("title", "nonexistent") self.assertRaisesMessage(ImproperlyConfigured, - str_prefix("SongAdmin.readonly_fields[1], %(_)s'nonexistant' is not a callable " + str_prefix("SongAdmin.readonly_fields[1], %(_)s'nonexistent' is not a callable " "or an attribute of 'SongAdmin' or found in the model 'Song'."), SongAdmin.validate, Song) diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py index ba523265c21..a5b3df3b9e7 100644 --- a/tests/admin_views/admin.py +++ b/tests/admin_views/admin.py @@ -420,7 +420,7 @@ class PostAdmin(admin.ModelAdmin): if instance.pk: return "%d amount of cool." % instance.pk else: - return "Unkown coolness." + return "Unknown coolness." def value(self, instance): return 1000 diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 60220bb0f07..384d31c2a36 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1045,8 +1045,8 @@ class AdminViewPermissionsTest(TestCase): """ Make sure only staff members can log in. - Successful posts to the login page will redirect to the orignal url. - Unsuccessfull attempts will continue to render the login page with + Successful posts to the login page will redirect to the original url. + Unsuccessful attempts will continue to render the login page with a 200 status code. """ login_url = reverse('admin:login') + '?next=/test_admin/admin/' @@ -3649,7 +3649,7 @@ class ReadonlyTest(TestCase): self.assertContains(response, "") self.assertContains(response, "Very awesome.") - self.assertContains(response, "Unkown coolness.") + self.assertContains(response, "Unknown coolness.") self.assertContains(response, "foo") # Checks that multiline text in a readonly field gets
tags diff --git a/tests/datatypes/tests.py b/tests/datatypes/tests.py index 9cc88e9a660..e55405983dc 100644 --- a/tests/datatypes/tests.py +++ b/tests/datatypes/tests.py @@ -91,6 +91,6 @@ class DataTypesTestCase(TestCase): b = RumBaba.objects.create() # Verify we didn't break DateTimeField behavior self.assertIsInstance(b.baked_timestamp, datetime.datetime) - # We need to test this this way because datetime.datetime inherits + # We need to test this way because datetime.datetime inherits # from datetime.date: self.assertIsInstance(b.baked_date, datetime.date) and not isinstance(b.baked_date, datetime.datetime) diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py index 8b5bbdf0c98..10cf342529b 100644 --- a/tests/field_deconstruction/tests.py +++ b/tests/field_deconstruction/tests.py @@ -112,7 +112,7 @@ class FieldDeconstructionTests(TestCase): def test_decimal_field_0_decimal_places(self): """ - A DecimalField with decimal_places=0 shoudl work (#22272). + A DecimalField with decimal_places=0 should work (#22272). """ field = models.DecimalField(max_digits=5, decimal_places=0) name, path, args, kwargs = field.deconstruct() diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 35adb7c1ab6..0e574cbc569 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -162,9 +162,9 @@ class FileUploadTests(TestCase): response = self.client.request(**r) # The filenames should have been sanitized by the time it got to the view. - recieved = json.loads(response.content.decode('utf-8')) + received = json.loads(response.content.decode('utf-8')) for i, name in enumerate(scary_file_names): - got = recieved["file%s" % i] + got = received["file%s" % i] self.assertEqual(got, "hax0rd.txt") def test_filename_overflow(self): diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 16bfd61308c..8a6e9c83b18 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -101,7 +101,7 @@ class PrimaryKeyCharModel(models.Model): class FksToBooleans(models.Model): - """Model wih FKs to models with {Null,}BooleanField's, #15040""" + """Model with FKs to models with {Null,}BooleanField's, #15040""" bf = models.ForeignKey(BooleanModel) nbf = models.ForeignKey(NullBooleanModel) diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 12dbf06d0de..20bdc2b79e7 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -1844,7 +1844,7 @@ class FileAndImageFieldTests(TestCase): @skipUnless(test_images, "Pillow not installed") def test_image_field(self): - # ImageField and FileField are nearly identical, but they differ slighty when + # ImageField and FileField are nearly identical, but they differ slightly when # it comes to validation. This specifically tests that #6302 is fixed for # both file fields and image fields. diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py index 5297898e2f5..745a63f7e66 100644 --- a/tests/model_inheritance_regress/tests.py +++ b/tests/model_inheritance_regress/tests.py @@ -258,7 +258,7 @@ class ModelInheritanceTest(TestCase): self.assertEqual(m2mchildren, []) # Ordering should not include any database column more than once (this - # is most likely to ocurr naturally with model inheritance, so we + # is most likely to occur naturally with model inheritance, so we # check it here). Regression test for #9390. This necessarily pokes at # the SQL string for the query, since the duplicate problems are only # apparent at that late stage. @@ -363,10 +363,10 @@ class ModelInheritanceTest(TestCase): self.assertEqual(parties, [bachelor]) # Check that a subclass of a subclass of an abstract model doesn't get - # it's own accessor. + # its own accessor. self.assertFalse(hasattr(p2, 'messybachelorparty_set')) - # ... but it does inherit the m2m from it's parent + # ... but it does inherit the m2m from its parent messy = MessyBachelorParty.objects.create( name='Bachelor party for Dave') messy.attendees = [p4] diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 5cd2b27dfae..6d8996c1d86 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -2009,7 +2009,7 @@ class CloneTests(TestCase): n_list = Note.objects.all() # Evaluate the Note queryset, populating the query cache list(n_list) - # Use the note queryset in a query, and evalute + # Use the note queryset in a query, and evaluate # that query in a way that involves cloning. self.assertEqual(ExtraInfo.objects.filter(note__in=n_list)[0].info, 'good') diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 57c344ce8d4..0ab5bb03632 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -527,7 +527,7 @@ class SchemaTests(TransactionTestCase): UniqueTest.objects.create(year=2011, slug="bar") self.assertRaises(IntegrityError, UniqueTest.objects.create, year=2012, slug="foo") UniqueTest.objects.all().delete() - # Alter the model to it's non-unique-together companion + # Alter the model to its non-unique-together companion with connection.schema_editor() as editor: editor.alter_unique_together( UniqueTest, diff --git a/tests/syndication_tests/tests.py b/tests/syndication_tests/tests.py index ce70b038cde..facb413c7f6 100644 --- a/tests/syndication_tests/tests.py +++ b/tests/syndication_tests/tests.py @@ -317,7 +317,7 @@ class SyndicationFeedTest(FeedTestCase): Test that datetimes are correctly converted to the local time zone. """ # Naive date times passed in get converted to the local time zone, so - # check the recived zone offset against the local offset. + # check the received zone offset against the local offset. response = self.client.get('/syndication/naive-dates/') doc = minidom.parseString(response.content) updated = doc.getElementsByTagName('updated')[0].firstChild.wholeText diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py index ce2cc4a2c89..8791a11353b 100644 --- a/tests/template_tests/test_response.py +++ b/tests/template_tests/test_response.py @@ -167,7 +167,7 @@ class SimpleTemplateResponseTest(TestCase): self.assertEqual(unpickled_response['content-type'], response['content-type']) self.assertEqual(unpickled_response.status_code, response.status_code) - # ...and the unpickled reponse doesn't have the + # ...and the unpickled response doesn't have the # template-related attributes, so it can't be re-rendered template_attrs = ('template_name', 'context_data', '_post_render_callbacks') for attr in template_attrs: @@ -273,7 +273,7 @@ class TemplateResponseTest(TestCase): self.assertEqual(unpickled_response['content-type'], response['content-type']) self.assertEqual(unpickled_response.status_code, response.status_code) - # ...and the unpickled reponse doesn't have the + # ...and the unpickled response doesn't have the # template-related attributes, so it can't be re-rendered template_attrs = ('template_name', 'context_data', '_post_render_callbacks', '_request', '_current_app') diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 17030c75606..90279265adc 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -717,7 +717,7 @@ class TemplateTests(TestCase): 'basic-syntax27': (r'{{ _("\"fred\"") }}', {}, "\"fred\""), # regression test for ticket #12554 - # make sure a silent_variable_failure Exception is supressed + # make sure a silent_variable_failure Exception is suppressed # on dictionary and attribute lookup 'basic-syntax28': ("{{ a.b }}", {'a': SilentGetItemClass()}, ('', 'INVALID')), 'basic-syntax29': ("{{ a.b }}", {'a': SilentAttrClass()}, ('', 'INVALID')), diff --git a/tests/validators/tests.py b/tests/validators/tests.py index 25f1e1b2f27..928c482107f 100644 --- a/tests/validators/tests.py +++ b/tests/validators/tests.py @@ -88,7 +88,7 @@ TEST_DATA = ( (validate_ipv4_address, '25.1 .1.1', ValidationError), # validate_ipv6_address uses django.utils.ipv6, which - # is tested in much greater detail in it's own testcase + # is tested in much greater detail in its own testcase (validate_ipv6_address, 'fe80::1', None), (validate_ipv6_address, '::1', None), (validate_ipv6_address, '1:2:3:4:5:6:7:8', None),