From 97e637a87fb45c4de970cca6cb783d93473c9d15 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Wed, 1 Aug 2018 12:55:53 -0400 Subject: [PATCH] Fixed typos in comments and docs. --- django/contrib/auth/models.py | 2 +- django/contrib/gis/db/backends/postgis/operations.py | 2 +- django/contrib/gis/gdal/feature.py | 2 +- django/core/serializers/base.py | 2 +- django/db/migrations/operations/base.py | 2 +- django/db/models/sql/where.py | 2 +- django/template/base.py | 2 +- django/template/defaultfilters.py | 4 ++-- docs/intro/tutorial02.txt | 2 +- docs/ref/contrib/gis/tutorial.txt | 2 +- docs/ref/models/instances.txt | 2 +- docs/spelling_wordlist | 1 - tests/admin_changelist/tests.py | 2 +- tests/admin_views/tests.py | 6 +++--- tests/dbshell/test_postgresql_psycopg2.py | 2 +- tests/forms_tests/widget_tests/test_selectdatewidget.py | 2 +- tests/httpwrappers/tests.py | 2 +- tests/indexes/tests.py | 2 +- tests/pagination/tests.py | 2 +- tests/template_tests/syntax_tests/test_cache.py | 2 +- 20 files changed, 22 insertions(+), 23 deletions(-) diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index c4ccf5b4ef..cc4f48861a 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -276,7 +276,7 @@ class PermissionsMixin(models.Model): def has_module_perms(self, app_label): """ Return True if the user has any permissions in the given app label. - Use simlar logic as has_perm(), above. + Use similar logic as has_perm(), above. """ # Active superusers have all permissions. if self.is_active and self.is_superuser: diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py index dd3fdb37b0..b6add9390a 100644 --- a/django/contrib/gis/db/backends/postgis/operations.py +++ b/django/contrib/gis/db/backends/postgis/operations.py @@ -31,7 +31,7 @@ class PostGISOperator(SpatialOperator): # geography type. self.geography = geography # Only a subset of the operators and functions are available for the - # raster type. Lookups that don't suport raster will be converted to + # raster type. Lookups that don't support raster will be converted to # polygons. If the raster argument is set to BILATERAL, then the # operator cannot handle mixed geom-raster lookups. self.raster = raster diff --git a/django/contrib/gis/gdal/feature.py b/django/contrib/gis/gdal/feature.py index db8c981312..a8aadbf883 100644 --- a/django/contrib/gis/gdal/feature.py +++ b/django/contrib/gis/gdal/feature.py @@ -94,7 +94,7 @@ class Feature(GDALBase): @property def geom_type(self): - "Return the OGR Geometry Type for this Feture." + "Return the OGR Geometry Type for this Feature." return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn)) # #### Feature Methods #### diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py index 0d7946dc3f..624fc312bd 100644 --- a/django/core/serializers/base.py +++ b/django/core/serializers/base.py @@ -188,7 +188,7 @@ class Deserializer: return self def __next__(self): - """Iteration iterface -- return the next item in the stream""" + """Iteration interface -- return the next item in the stream""" raise NotImplementedError('subclasses of Deserializer must provide a __next__() method') diff --git a/django/db/migrations/operations/base.py b/django/db/migrations/operations/base.py index a29e5230c7..b2f4ddd7d4 100644 --- a/django/db/migrations/operations/base.py +++ b/django/db/migrations/operations/base.py @@ -103,7 +103,7 @@ class Operation: def allow_migrate_model(self, connection_alias, model): """ - Return wether or not a model may be migrated. + Return whether or not a model may be migrated. This is a thin wrapper around router.allow_migrate_model() that preemptively rejects any proxy, swapped out, or unmanaged model. diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index d913abab2e..879de0474a 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -142,7 +142,7 @@ class WhereNode(tree.Node): def clone(self): """ Create a clone of the tree. Must only be called on root nodes (nodes - with empty subtree_parents). Childs must be either (Contraint, lookup, + with empty subtree_parents). Childs must be either (Constraint, lookup, value) tuples, or objects supporting .clone(). """ clone = self.__class__._new_instance( diff --git a/django/template/base.py b/django/template/base.py index f6a60ecdf7..9f4fe3363d 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -760,7 +760,7 @@ class Variable: # catching. Since this should only happen at compile time, that's # probably OK. - # Try to interpret values containg a period or an 'e'/'E' + # Try to interpret values containing a period or an 'e'/'E' # (possibly scientific notation) as a float; otherwise, try int. if '.' in var or 'e' in var.lower(): self.literal = float(var) diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index 53b9ade716..400ce7ceb5 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -222,8 +222,8 @@ def stringformat(value, arg): """ Format the variable according to the arg, a string formatting specifier. - This specifier uses Python string formating syntax, with the exception that - the leading "%" is dropped. + This specifier uses Python string formatting syntax, with the exception + that the leading "%" is dropped. See https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting for documentation of Python string formatting. diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 631536b515..c1f0aeef46 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -362,7 +362,7 @@ but for now, remember the three-step guide to making model changes: The reason that there are separate commands to make and apply migrations is because you'll commit migrations to your version control system and ship them with your app; they not only make your development easier, they're also -useable by other developers and in production. +usable by other developers and in production. Read the :doc:`django-admin documentation ` for full information on what the ``manage.py`` utility can do. diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt index 7c730e41aa..23a4111aec 100644 --- a/docs/ref/contrib/gis/tutorial.txt +++ b/docs/ref/contrib/gis/tutorial.txt @@ -742,7 +742,7 @@ Next, start up the Django development server: Finally, browse to ``http://localhost:8000/admin/``, and log in with the user you just created. Browse to any of the ``WorldBorder`` entries -- the borders -may be edited by clicking on a polygon and dragging the vertexes to the desired +may be edited by clicking on a polygon and dragging the vertices to the desired position. .. _OpenLayers: https://openlayers.org/ diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 23572f7362..35be4e5107 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -664,7 +664,7 @@ For example:: # Primary keys compared MyModel(id=1) == MyModel(id=1) MyModel(id=1) != MyModel(id=2) - # Primay keys are None + # Primary keys are None MyModel(id=None) != MyModel(id=None) # Same instance instance = MyModel(id=None) diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist index 33d3ad2dac..6721a77e6f 100644 --- a/docs/spelling_wordlist +++ b/docs/spelling_wordlist @@ -749,7 +749,6 @@ url urljoins urlpatterns urls -useable username usernames utc diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index 6c9b424a5a..c12bfc7c93 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -347,7 +347,7 @@ class ChangeListTests(TestCase): """ Regression test for #13902: When using a ManyToMany in list_filter, results shouldn't appear more than once. Model managed in the - admin inherits from the one that defins the relationship. + admin inherits from the one that defines the relationship. """ lead = Musician.objects.create(name='John') four = Quartet.objects.create(name='The Beatles') diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index fe9a02e37a..6b1d23e31e 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1760,7 +1760,7 @@ class AdminViewPermissionsTest(TestCase): self.client.get(reverse('admin:logout')) # view user should be able to view the article but not change any of them - # (the POST can be sent, but no modification occures) + # (the POST can be sent, but no modification occurs) self.client.force_login(self.viewuser) response = self.client.get(article_changelist_url) self.assertEqual(response.status_code, 200) @@ -2240,7 +2240,7 @@ class AdminViewPermissionsTest(TestCase): def test_post_save_message_no_forbidden_links_visible(self): """ Post-save message shouldn't contain a link to the change form if the - user doen't have the change permission. + user doesn't have the change permission. """ self.client.force_login(self.adduser) # Emulate Article creation for user with add-only permission. @@ -3607,7 +3607,7 @@ class AdminCustomQuerysetTest(TestCase): # Test for #14529. only() is used in ModelAdmin.get_queryset() # model has __str__ method - t = Telegram.objects.create(title="Frist Telegram") + t = Telegram.objects.create(title="First Telegram") self.assertEqual(Telegram.objects.count(), 1) response = self.client.get(reverse('admin:admin_views_telegram_change', args=(t.pk,))) self.assertEqual(response.status_code, 200) diff --git a/tests/dbshell/test_postgresql_psycopg2.py b/tests/dbshell/test_postgresql_psycopg2.py index a229e13a47..8e5af5f1f3 100644 --- a/tests/dbshell/test_postgresql_psycopg2.py +++ b/tests/dbshell/test_postgresql_psycopg2.py @@ -112,5 +112,5 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): self.assertNotEqual(sigint_handler, signal.SIG_IGN) with mock.patch('subprocess.check_call', new=_mock_subprocess_call): DatabaseClient.runshell_db({}) - # dbshell restores the orignal handler. + # dbshell restores the original handler. self.assertEqual(sigint_handler, signal.getsignal(signal.SIGINT)) diff --git a/tests/forms_tests/widget_tests/test_selectdatewidget.py b/tests/forms_tests/widget_tests/test_selectdatewidget.py index 7f8379c556..f9921af5f9 100644 --- a/tests/forms_tests/widget_tests/test_selectdatewidget.py +++ b/tests/forms_tests/widget_tests/test_selectdatewidget.py @@ -317,7 +317,7 @@ class SelectDateWidgetTest(WidgetTest): def test_selectdate_empty_label(self): w = SelectDateWidget(years=('2014',), empty_label='empty_label') - # Rendering the default state with empty_label setted as string. + # Rendering the default state with empty_label set as string. self.assertInHTML('', w.render('mydate', ''), count=3) w = SelectDateWidget(years=('2014',), empty_label=('empty_year', 'empty_month', 'empty_day')) diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 985380cc57..24260ae610 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -733,7 +733,7 @@ class CookieTests(unittest.TestCase): # Chunks without an equals sign appear as unnamed values per # https://bugzilla.mozilla.org/show_bug.cgi?id=169091 self.assertIn('django_language', parse_cookie('abc=def; unnamed; django_language=en')) - # Even a double quote may be an unamed value. + # Even a double quote may be an unnamed value. self.assertEqual(parse_cookie('a=b; "; c=d'), {'a': 'b', '': '"', 'c': 'd'}) # Spaces in names and values, and an equals sign in values. self.assertEqual(parse_cookie('a b c=d e = f; gh=i'), {'a b c': 'd e = f', 'gh': 'i'}) diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py index 219dfe67b1..8dc81da6aa 100644 --- a/tests/indexes/tests.py +++ b/tests/indexes/tests.py @@ -81,7 +81,7 @@ class SchemaIndexesNotPostgreSQLTests(TransactionTestCase): opclasses=['varchar_pattern_ops'], ) with connection.schema_editor() as editor: - # This would error if opclasses weren't ingored. + # This would error if opclasses weren't ignored. editor.add_index(IndexedArticle2, index) diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index 987e713405..48d4acbb11 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -376,7 +376,7 @@ class ModelPaginationTests(TestCase): def test_paginating_unordered_object_list_raises_warning(self): """ - Unordered object list warning with an object that has an orderd + Unordered object list warning with an object that has an ordered attribute but not a model attribute. """ class ObjectList: diff --git a/tests/template_tests/syntax_tests/test_cache.py b/tests/template_tests/syntax_tests/test_cache.py index 6a59cb3c75..80af1c2bd6 100644 --- a/tests/template_tests/syntax_tests/test_cache.py +++ b/tests/template_tests/syntax_tests/test_cache.py @@ -108,7 +108,7 @@ class CacheTagTests(SimpleTestCase): 'As plurdled gabbleblotchits/On a lurgid bee/' 'That mordiously hath bitled out/Its earted jurtles/' 'Into a rancid festering/Or else I shall rend thee in the gobberwarts' - 'with my blurglecruncheon/See if I dont.' + 'with my blurglecruncheon/See if I don\'t.' ), } )