diff --git a/django/contrib/contenttypes/views.py b/django/contrib/contenttypes/views.py index d67f071569..cdbc58fa3f 100644 --- a/django/contrib/contenttypes/views.py +++ b/django/contrib/contenttypes/views.py @@ -50,7 +50,7 @@ def shortcut(request, content_type_id, object_id): opts = obj._meta - # First, look for an many-to-many relationship to Site. + # First, look for a many-to-many relationship to Site. for field in opts.many_to_many: if field.remote_field.model is Site: try: diff --git a/django/contrib/staticfiles/finders.py b/django/contrib/staticfiles/finders.py index 2fbd0763f5..afce4ca637 100644 --- a/django/contrib/staticfiles/finders.py +++ b/django/contrib/staticfiles/finders.py @@ -204,7 +204,7 @@ class BaseStorageFinder(BaseFinder): raise ImproperlyConfigured("The staticfiles storage finder %r " "doesn't have a storage class " "assigned." % self.__class__) - # Make sure we have an storage instance here. + # Make sure we have a storage instance here. if not isinstance(self.storage, (Storage, LazyObject)): self.storage = self.storage() super().__init__(*args, **kwargs) diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py index 3ba7f995c6..8f1d26ea5f 100644 --- a/django/core/files/uploadedfile.py +++ b/django/core/files/uploadedfile.py @@ -15,7 +15,7 @@ __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile', class UploadedFile(File): """ - A abstract uploaded file (``TemporaryUploadedFile`` and + An abstract uploaded file (``TemporaryUploadedFile`` and ``InMemoryUploadedFile`` are the built-in concrete subclasses). An ``UploadedFile`` object behaves somewhat like a file object and diff --git a/django/core/mail/backends/filebased.py b/django/core/mail/backends/filebased.py index 2d1238665e..ddcd9ed97b 100644 --- a/django/core/mail/backends/filebased.py +++ b/django/core/mail/backends/filebased.py @@ -21,7 +21,7 @@ class EmailBackend(ConsoleEmailBackend): if not isinstance(self.file_path, str): raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path) self.file_path = os.path.abspath(self.file_path) - # Make sure that self.file_path is an directory if it exists. + # Make sure that self.file_path is a directory if it exists. if os.path.exists(self.file_path) and not os.path.isdir(self.file_path): raise ImproperlyConfigured( 'Path for saving email messages exists, but is not a directory: %s' % self.file_path diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index 786957e86f..bed6be14e4 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -72,7 +72,7 @@ class Command(BaseCommand): self.loaddata(fixture_labels) # Close the DB connection -- unless we're still in a transaction. This - # is required as a workaround for an edge case in MySQL: if the same + # is required as a workaround for an edge case in MySQL: if the same # connection is used to create tables, load data, and query, the query # can return incorrect results. See Django #7572, MySQL #37735. if transaction.get_autocommit(self.using): diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py index 706e37a6bd..12f7fb0b9b 100644 --- a/django/db/models/fields/related_lookups.py +++ b/django/db/models/fields/related_lookups.py @@ -63,7 +63,7 @@ class RelatedIn(In): if isinstance(self.lhs, MultiColSource): # For multicolumn lookups we need to build a multicolumn where clause. # This clause is either a SubqueryConstraint (for values that need to be compiled to - # SQL) or a OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses. + # SQL) or an OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses. from django.db.models.sql.where import WhereNode, SubqueryConstraint, AND, OR root_constraint = WhereNode(connector=OR) diff --git a/django/http/response.py b/django/http/response.py index 1083fd7dca..ae14333053 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -489,7 +489,7 @@ class JsonResponse(HttpResponse): :param data: Data to be dumped into json. By default only ``dict`` objects are allowed to be passed due to a security flaw before EcmaScript 5. See the ``safe`` parameter for more information. - :param encoder: Should be an json encoder class. Defaults to + :param encoder: Should be a json encoder class. Defaults to ``django.core.serializers.json.DjangoJSONEncoder``. :param safe: Controls if only ``dict`` objects may be serialized. Defaults to ``True``. diff --git a/django/shortcuts.py b/django/shortcuts.py index ab330db601..6b35e64f4e 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -79,8 +79,8 @@ def get_object_or_404(klass, *args, **kwargs): klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in the get() query. - Note: Like with get(), an MultipleObjectsReturned will be raised if more than one - object is found. + Like with QuerySet.get(), MultipleObjectsReturned is raised if more than + one object is found. """ queryset = _get_queryset(klass) try: diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py index ad2f2b1c67..6c840a315a 100644 --- a/django/views/generic/edit.py +++ b/django/views/generic/edit.py @@ -159,7 +159,7 @@ class FormView(TemplateResponseMixin, BaseFormView): class BaseCreateView(ModelFormMixin, ProcessFormView): """ - Base view for creating an new object instance. + Base view for creating a new object instance. Using this base class requires subclassing to provide a response mixin. """ diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 4c1b5eb0d7..204016b900 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1862,7 +1862,7 @@ __ https://github.com/django/django/blob/master/django/utils/log.py Default: ``'logging.config.dictConfig'`` A path to a callable that will be used to configure logging in the -Django project. Points at a instance of Python's :ref:`dictConfig +Django project. Points at an instance of Python's :ref:`dictConfig ` configuration method by default. If you set :setting:`LOGGING_CONFIG` to ``None``, the logging diff --git a/docs/releases/1.1.txt b/docs/releases/1.1.txt index 1ef5667336..3a359559bd 100644 --- a/docs/releases/1.1.txt +++ b/docs/releases/1.1.txt @@ -207,7 +207,7 @@ detail in :doc:`the ORM aggregation documentation `. Query expressions ~~~~~~~~~~~~~~~~~ -Queries can now refer to a another field on the query and can traverse +Queries can now refer to another field on the query and can traverse relationships to refer to fields on related models. This is implemented in the new :class:`~django.db.models.F` object; for full details, including examples, consult the :class:`F expressions documentation `. diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py index eb394f794f..f4fabef301 100644 --- a/tests/admin_checks/tests.py +++ b/tests/admin_checks/tests.py @@ -354,7 +354,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_generic_inline_model_admin_non_generic_model(self): """ A model without a GenericForeignKey raises problems if it's included - in an GenericInlineModelAdmin definition. + in a GenericInlineModelAdmin definition. """ class BookInline(GenericStackedInline): model = Book diff --git a/tests/auth_tests/test_checks.py b/tests/auth_tests/test_checks.py index 3f86e7a80e..8c3e323efa 100644 --- a/tests/auth_tests/test_checks.py +++ b/tests/auth_tests/test_checks.py @@ -57,8 +57,8 @@ class UserModelChecksTests(SimpleTestCase): @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserNonUniqueUsername') def test_username_non_unique(self): """ - A non-unique USERNAME_FIELD should raise an error only if we use the - default authentication backend. Otherwise, an warning should be raised. + A non-unique USERNAME_FIELD raises an error only if the default + authentication backend is used. Otherwise, a warning is raised. """ errors = checks.run_checks() self.assertEqual(errors, [ diff --git a/tests/files/tests.py b/tests/files/tests.py index a414a81ad3..3999794154 100644 --- a/tests/files/tests.py +++ b/tests/files/tests.py @@ -244,7 +244,7 @@ class DimensionClosingBug(unittest.TestCase): """ # We need to inject a modified open() builtin into the images module # that checks if the file was closed properly if the function is - # called with a filename instead of an file object. + # called with a filename instead of a file object. # get_image_dimensions will call our catching_open instead of the # regular builtin one. diff --git a/tests/m2m_through_regress/models.py b/tests/m2m_through_regress/models.py index 1214c93ea1..391ddc69c0 100644 --- a/tests/m2m_through_regress/models.py +++ b/tests/m2m_through_regress/models.py @@ -40,7 +40,7 @@ class Group(models.Model): return self.name -# A set of models that use an non-abstract inherited model as the 'through' model. +# A set of models that use a non-abstract inherited model as the 'through' model. class A(models.Model): a_text = models.CharField(max_length=20) diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py index a05a24e597..dd33fdf96f 100644 --- a/tests/managers_regress/tests.py +++ b/tests/managers_regress/tests.py @@ -65,7 +65,7 @@ class ManagersRegressionTests(TestCase): AbstractBase3.objects.all() def test_custom_abstract_manager(self): - # Accessing the manager on an abstract model with an custom + # Accessing the manager on an abstract model with a custom # manager should raise an attribute error with an appropriate # message. msg = "Manager isn't available; AbstractBase2 is abstract" diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py index 5052c6d471..0e3395bf3a 100644 --- a/tests/many_to_one/tests.py +++ b/tests/many_to_one/tests.py @@ -570,12 +570,12 @@ class ManyToOneTests(TestCase): Third.objects.create(name='Third 1') Third.objects.create(name='Third 2') th = Third(name="testing") - # The object isn't saved an thus the relation field is null - we won't even + # The object isn't saved and thus the relation field is null - we won't even # execute a query in this case. with self.assertNumQueries(0): self.assertEqual(th.child_set.count(), 0) th.save() - # Now the model is saved, so we will need to execute an query. + # Now the model is saved, so we will need to execute a query. with self.assertNumQueries(1): self.assertEqual(th.child_set.count(), 0) @@ -591,7 +591,7 @@ class ManyToOneTests(TestCase): self.assertEqual(public_student.school, public_school) - # Make sure the base manager is used so that an student can still access + # Make sure the base manager is used so that a student can still access # its related school even if the default manager doesn't normally # allow it. self.assertEqual(private_student.school, private_school) diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py index 74961048fb..95aeec57aa 100644 --- a/tests/migrations/test_autodetector.py +++ b/tests/migrations/test_autodetector.py @@ -1146,7 +1146,7 @@ class AutodetectorTests(TestCase): # a CreateModel operation w/o any definition on the original model model_state_not_specified = ModelState("a", "model", [("id", models.AutoField(primary_key=True))]) # Explicitly testing for None, since this was the issue in #23452 after - # a AlterFooTogether operation with e.g. () as value + # an AlterFooTogether operation with e.g. () as value model_state_none = ModelState("a", "model", [ ("id", models.AutoField(primary_key=True)) ], { diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index e6aaa8fc90..8caa0b5deb 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -155,7 +155,7 @@ class MigrateTests(MigrationTestBase): # Fails because "migrations_tribble" does not exist but needs to in # order to make --fake-initial work. call_command("migrate", "migrations", fake_initial=True, verbosity=0) - # Fake a apply + # Fake an apply call_command("migrate", "migrations", fake=True, verbosity=0) call_command("migrate", "migrations", fake=True, verbosity=0, database="other") # Unmigrate everything diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py index cb0b530063..e3977ee316 100644 --- a/tests/model_regress/tests.py +++ b/tests/model_regress/tests.py @@ -188,7 +188,7 @@ class ModelTests(TestCase): @skipUnlessDBFeature("supports_timezones") def test_timezones(self): - # Saving an updating with timezone-aware datetime Python objects. + # Saving and updating with timezone-aware datetime Python objects. # Regression test for #10443. # The idea is that all these creations and saving should work without # crashing. It's not rocket science. diff --git a/tests/proxy_models/models.py b/tests/proxy_models/models.py index d0603886e0..5e6fdd2b93 100644 --- a/tests/proxy_models/models.py +++ b/tests/proxy_models/models.py @@ -69,7 +69,7 @@ class ManagerMixin(models.Model): class OtherPerson(Person, ManagerMixin): """ - A class with the default manager from Person, plus an secondary manager. + A class with the default manager from Person, plus a secondary manager. """ class Meta: proxy = True diff --git a/tests/requests/tests.py b/tests/requests/tests.py index a3eb9632a3..bc99818797 100644 --- a/tests/requests/tests.py +++ b/tests/requests/tests.py @@ -235,7 +235,7 @@ class RequestsTests(SimpleTestCase): self.assertEqual(response.cookies['c']['expires'], '') def test_far_expiration(self): - "Cookie will expire when an distant expiration time is provided" + "Cookie will expire when a distant expiration time is provided" response = HttpResponse() response.set_cookie('datetime', expires=datetime(2028, 1, 1, 4, 5, 6)) datetime_cookie = response.cookies['datetime'] diff --git a/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot b/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot index 7c58b2e622..fdd7138c52 100644 --- a/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot +++ b/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot @@ -1 +1 @@ -not really a EOT ;) \ No newline at end of file +not really an EOT ;) \ No newline at end of file diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py index 12d4c85c01..318da6a226 100644 --- a/tests/staticfiles_tests/test_storage.py +++ b/tests/staticfiles_tests/test_storage.py @@ -96,10 +96,10 @@ class TestHashedFiles: def test_path_with_querystring_and_fragment(self): relpath = self.hashed_file_path("cached/css/fragments.css") - self.assertEqual(relpath, "cached/css/fragments.c4e6753b52d3.css") + self.assertEqual(relpath, "cached/css/fragments.a60c0e74834f.css") with storage.staticfiles_storage.open(relpath) as relfile: content = relfile.read() - self.assertIn(b'fonts/font.a4b0478549d0.eot?#iefix', content) + self.assertIn(b'fonts/font.b9b105392eb8.eot?#iefix', content) self.assertIn(b'fonts/font.b8d603e42714.svg#webfontIyfZbseF', content) self.assertIn(b'fonts/font.b8d603e42714.svg#path/to/../../fonts/font.svg', content) self.assertIn(b'data:font/woff;charset=utf-8;base64,d09GRgABAAAAADJoAA0AAAAAR2QAAQAAAAAAAAAAAAA', content)