diff --git a/django/contrib/auth/tests/test_hashers.py b/django/contrib/auth/tests/test_hashers.py index e8b6d887b59..740ba462a2e 100644 --- a/django/contrib/auth/tests/test_hashers.py +++ b/django/contrib/auth/tests/test_hashers.py @@ -269,7 +269,7 @@ class TestUtilsHashPass(SimpleTestCase): def setter(password): state['upgraded'] = True - # Check that no upgrade is triggerd + # Check that no upgrade is triggered self.assertTrue(check_password('letmein', encoded, setter)) self.assertFalse(state['upgraded']) @@ -298,7 +298,7 @@ class TestUtilsHashPass(SimpleTestCase): algo, iterations, salt, hash = encoded.split('$', 3) self.assertEqual(iterations, '1') - # Check that no upgrade is triggerd + # Check that no upgrade is triggered self.assertTrue(check_password('letmein', encoded, setter)) self.assertFalse(state['upgraded']) diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py index 9d093bfa328..48d4aabf136 100644 --- a/django/contrib/gis/geos/tests/test_geos.py +++ b/django/contrib/gis/geos/tests/test_geos.py @@ -63,7 +63,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): # Anything that is either not None or the acceptable pointer type will # result in a TypeError when trying to assign it to the `ptr` property. - # Thus, memmory addresses (integers) and pointers of the incorrect type + # Thus, memory addresses (integers) and pointers of the incorrect type # (in `bad_ptrs`) will not be allowed. bad_ptrs = (5, ctypes.c_char_p(b'foobar')) for bad_ptr in bad_ptrs: diff --git a/django/contrib/gis/tests/geoapp/test_regress.py b/django/contrib/gis/tests/geoapp/test_regress.py index e5cefb0752e..85dc1c139a3 100644 --- a/django/contrib/gis/tests/geoapp/test_regress.py +++ b/django/contrib/gis/tests/geoapp/test_regress.py @@ -83,7 +83,7 @@ class GeoRegressionTests(TestCase): val1 = Truth.objects.get(pk=t1.pk).val val2 = Truth.objects.get(pk=t2.pk).val - # verify types -- should't be 0/1 + # verify types -- shouldn't be 0/1 self.assertIsInstance(val1, bool) self.assertIsInstance(val2, bool) # verify values diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index 0dc4ce269d7..31a26944217 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -456,7 +456,7 @@ class GeoQuerySetTest(TestCase): geom = Point(5, 23) qs = Country.objects.all().difference(geom).sym_difference(geom).union(geom) - # XXX For some reason SpatiaLite does something screwey with the Texas geometry here. Also, + # XXX For some reason SpatiaLite does something screwy with the Texas geometry here. Also, # XXX it doesn't like the null intersection. if spatialite: qs = qs.exclude(name='Texas') @@ -599,7 +599,7 @@ class GeoQuerySetTest(TestCase): @skipUnlessDBFeature("has_gml_method") def test_gml(self): "Testing GML output from the database using GeoQuerySet.gml()." - # Should throw a TypeError when tyring to obtain GML from a + # Should throw a TypeError when trying to obtain GML from a # non-geometry field. qs = City.objects.all() self.assertRaises(TypeError, qs.gml, field_name='name') diff --git a/django/db/backends/base/creation.py b/django/db/backends/base/creation.py index 073f18e0018..30e094cfe7c 100644 --- a/django/db/backends/base/creation.py +++ b/django/db/backends/base/creation.py @@ -112,7 +112,7 @@ class BaseDatabaseCreation(object): queryset = model._default_manager.using(self.connection.alias).order_by(model._meta.pk.name) for obj in queryset.iterator(): yield obj - # Serialise to a string + # Serialize to a string out = StringIO() serializers.serialize("json", get_objects(), indent=None, stream=out) return out.getvalue() diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 51fb2783ebb..d7ee805bb1c 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -195,7 +195,7 @@ class MigrationLoader(object): for key, migration in normal.items(): for parent in migration.dependencies: reverse_dependencies.setdefault(parent, set()).add(key) - # Remeber the possible replacements to generate more meaningful error + # Remember the possible replacements to generate more meaningful error # messages reverse_replacements = {} for key, migration in replacing.items(): diff --git a/django/db/migrations/optimizer.py b/django/db/migrations/optimizer.py index c39bf15453a..8c5ee718194 100644 --- a/django/db/migrations/optimizer.py +++ b/django/db/migrations/optimizer.py @@ -229,7 +229,7 @@ class MigrationOptimizer(object): def reduce_create_model_add_field(self, operation, other, in_between): if operation.name_lower == other.model_name_lower: - # Don't allow optimisations of FKs through models they reference + # Don't allow optimizations of FKs through models they reference if hasattr(other.field, "rel") and other.field.rel: for between in in_between: # Check that it doesn't point to the model diff --git a/django/forms/models.py b/django/forms/models.py index befb49ddc95..7d5473276cb 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -538,7 +538,7 @@ def modelform_factory(model, form=ModelForm, fields=None, exclude=None, "'exclude' explicitly is prohibited." ) - # Instatiate type(form) in order to use the same metaclass as form. + # Instantiate type(form) in order to use the same metaclass as form. return type(form)(class_name, (form,), form_class_attrs) diff --git a/django/utils/regex_helper.py b/django/utils/regex_helper.py index a43234ad05f..53736dffa77 100644 --- a/django/utils/regex_helper.py +++ b/django/utils/regex_helper.py @@ -165,7 +165,7 @@ def normalize(pattern): else: result.append(Group((("%%(%s)s" % param), None))) elif ch in "*?+{": - # Quanitifers affect the previous item in the result list. + # Quantifiers affect the previous item in the result list. count, ch = get_quantifier(ch, pattern_iter) if ch: # We had to look ahead, but it wasn't need to compute the diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index f3182cd2464..ea3c0704b3c 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -71,7 +71,7 @@ class AdminCustomUrlsTest(TestCase): self.assertContains(response, 'Change action') # Should correctly get the change_view for the model instance with the - # funny-looking PK (the one wth a 'path/to/html/document.html' value) + # funny-looking PK (the one with a 'path/to/html/document.html' value) url = reverse('admin:%s_action_change' % Action._meta.app_label, args=(quote("path/to/html/document.html"),)) response = self.client.get(url) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 486680fda79..090546c474d 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1788,7 +1788,7 @@ class AdminViewsNoUrlTest(TestCase): self.client.get('/test_admin/admin/') r = self.client.post(reverse('admin:login'), self.changeuser_login) r = self.client.get('/test_admin/admin/') - # we shouldn' get an 500 error caused by a NoReverseMatch + # we shouldn't get a 500 error caused by a NoReverseMatch self.assertEqual(r.status_code, 200) self.client.get('/test_admin/admin/logout/') diff --git a/tests/backends/tests.py b/tests/backends/tests.py index 04b5cd5b01b..459184ed859 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -771,7 +771,7 @@ class FkConstraintsTests(TransactionTestCase): models.Article.objects.create(headline='Another article', pub_date=datetime.datetime(1988, 5, 15), reporter=self.r, reporter_proxy=r_proxy) - # Retreive the second article from the DB + # Retrieve the second article from the DB a2 = models.Article.objects.get(headline='Another article') a2.reporter_proxy_id = 30 self.assertRaises(IntegrityError, a2.save) diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 3ba94d058d1..72fdbaa8d82 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -357,7 +357,7 @@ class ModelTest(TestCase): Article.objects.create(headline=lazy, pub_date=datetime.now()) article = Article.objects.get() self.assertEqual(article.headline, notlazy) - # test that assign + save works with Promise objecs + # test that assign + save works with Promise objects article.headline = lazy article.save() self.assertEqual(article.headline, notlazy) diff --git a/tests/delete/tests.py b/tests/delete/tests.py index 2d6c02b9a96..c04284e0690 100644 --- a/tests/delete/tests.py +++ b/tests/delete/tests.py @@ -324,7 +324,7 @@ class DeletionTests(TestCase): # One query for Avatar.objects.all() and then one related fast delete for # each batch. fetches_to_mem = 1 + batches - # The Avatar objecs are going to be deleted in batches of GET_ITERATOR_CHUNK_SIZE + # The Avatar objects are going to be deleted in batches of GET_ITERATOR_CHUNK_SIZE queries = fetches_to_mem + TEST_SIZE // GET_ITERATOR_CHUNK_SIZE self.assertNumQueries(queries, Avatar.objects.all().delete) self.assertFalse(Avatar.objects.exists()) diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 130a3c7649e..34681122e4c 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -187,7 +187,7 @@ class FileUploadTests(TestCase): # trying such an attack. scary_file_names = [ "/tmp/hax0rd.txt", # Absolute path, *nix-style. - "C:\\Windows\\hax0rd.txt", # Absolute path, win-syle. + "C:\\Windows\\hax0rd.txt", # Absolute path, win-style. "C:/Windows/hax0rd.txt", # Absolute path, broken-style. "\\tmp\\hax0rd.txt", # Absolute path, broken in a different way. "/tmp\\hax0rd.txt", # Absolute path, broken by mixing. diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index 5599ec6ccf8..ababa689ded 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -389,7 +389,7 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin): # MultiWidget and MultiValueField ############################################# # MultiWidgets are widgets composed of other widgets. They are usually # combined with MultiValueFields - a field that is composed of other fields. - # MulitWidgets can themselved be composed of other MultiWidgets. + # MulitWidgets can themselves be composed of other MultiWidgets. # SplitDateTimeWidget is one example of a MultiWidget. class ComplexMultiWidget(MultiWidget): diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index d04001b6b2c..003df1c3a24 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -1026,7 +1026,7 @@ class FieldsTests(SimpleTestCase): def test_typedchoicefield_4(self): # Even more weirdness: if you have a valid choice but your coercion function - # can't coerce, yo'll still get a validation error. Don't do this! + # can't coerce, you'll still get a validation error. Don't do this! f = TypedChoiceField(choices=[('A', 'A'), ('B', 'B')], coerce=int) self.assertRaisesMessage(ValidationError, "'Select a valid choice. B is not one of the available choices.'", f.clean, 'B') # Required fields require values diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py index 94e27044ffe..276bf1cb228 100644 --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -893,7 +893,7 @@ class FormsFormsetTestCase(TestCase): except IndexError: pass - # Formets can override the default iteration order + # Formsets can override the default iteration order class BaseReverseFormSet(BaseFormSet): def __iter__(self): return reversed(self.forms) diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index ad96f978bd9..94948b203eb 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -510,7 +510,7 @@ class SymlinkExtractorTests(ExtractorTests): else: # On Python >= 3.2) os.symlink() exists always but then can # fail at runtime when user hasn't the needed permissions on - # WIndows versions that support symbolink links (>= 6/Vista). + # Windows versions that support symbolink links (>= 6/Vista). # See Python issue 9333 (http://bugs.python.org/issue9333). # Skip the test in that case try: diff --git a/tests/m2m_signals/tests.py b/tests/m2m_signals/tests.py index 31a83212f5d..ea4649551de 100644 --- a/tests/m2m_signals/tests.py +++ b/tests/m2m_signals/tests.py @@ -90,7 +90,7 @@ class ManyToManySignalsTest(TestCase): }) self.assertEqual(self.m2m_changed_messages, expected_messages) - # give the BMW and Toyata some doors as well + # give the BMW and Toyota some doors as well self.doors.car_set.add(self.bmw, self.toyota) expected_messages.append({ 'instance': self.doors, diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py index 6410477b361..a7dbdbe11c3 100644 --- a/tests/migrations/test_state.py +++ b/tests/migrations/test_state.py @@ -86,7 +86,7 @@ class StateTests(TestCase): mgr2 = FoodManager('x', 'y', c=3, d=4) class FoodOrderedManagers(models.Model): - # The managers on this model should be orderd by their creation + # The managers on this model should be ordered by their creation # counter and not by the order in model body food_no_mgr = NoMigrationFoodManager('x', 'y') diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 60a1f419ed5..5c8c8109d14 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -333,7 +333,7 @@ class BooleanFieldTests(unittest.TestCase): # Test select_related('fk_field_name') ma = FksToBooleans.objects.select_related('bf').get(pk=m1.id) - # verify types -- should't be 0/1 + # verify types -- shouldn't be 0/1 self.assertIsInstance(ma.bf.bfield, bool) self.assertIsInstance(ma.nbf.nbfield, bool) # verify values diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 80c5c6fa090..acd05c9bf2d 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -1067,7 +1067,7 @@ class ModelFormsetTest(TestCase): self.assertEqual(revision1.repository, repository) self.assertEqual(revision1.revision, '146239817507f148d448db38840db7c3cbf47c76') - # attempt to save the same revision against against the same repo. + # attempt to save the same revision against the same repo. data = { 'revision_set-TOTAL_FORMS': '1', 'revision_set-INITIAL_FORMS': '0', diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 3044faea6e4..34fbcde8ebe 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -1758,7 +1758,7 @@ class DisjunctiveFilterTests(TestCase): # Another variation on the disjunctive filtering theme. # For the purposes of this regression test, it's important that there is no - # Join object releated to the LeafA we create. + # Join object related to the LeafA we create. LeafA.objects.create(data='first') self.assertQuerysetEqual(LeafA.objects.all(), ['']) self.assertQuerysetEqual( diff --git a/tests/requests/tests.py b/tests/requests/tests.py index 306e5e76bbb..e9fdefb7ea8 100644 --- a/tests/requests/tests.py +++ b/tests/requests/tests.py @@ -352,7 +352,7 @@ class RequestsTests(SimpleTestCase): """ Reading body after parsing multipart/form-data is not allowed """ - # Because multipart is used for large amounts fo data i.e. file uploads, + # Because multipart is used for large amounts of data i.e. file uploads, # we don't want the data held in memory twice, and we don't want to # silence the error by setting body = '' either. payload = FakePayload("\r\n".join([ diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index f1a43763b66..0befd18e293 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -117,7 +117,7 @@ class ClassDecoratedTestCase(ClassDecoratedTestCaseSuper): self.assertEqual(settings.TEST, 'override') def test_setupclass_override(self): - """Test that settings are overriden within setUpClass -- refs #21281""" + """Test that settings are overridden within setUpClass -- refs #21281""" self.assertEqual(self.foo, 'override') @override_settings(TEST='override2')