From 45aaced91e4789c3a08b17f0908010923361dbec Mon Sep 17 00:00:00 2001 From: Adam Taylor Date: Tue, 20 Jan 2015 07:54:12 -0700 Subject: [PATCH] [1.8.x] Fixed typos in code comments. Backport of 039465a6a7a18f48ea77ceadb6949990c0ec92e1 from master --- django/contrib/auth/tests/test_hashers.py | 4 ++-- django/contrib/gis/geos/tests/test_geos.py | 2 +- django/contrib/gis/tests/geoapp/test_regress.py | 2 +- django/contrib/gis/tests/geoapp/tests.py | 4 ++-- django/db/backends/base/creation.py | 2 +- django/db/migrations/loader.py | 2 +- django/db/migrations/optimizer.py | 2 +- django/forms/models.py | 2 +- django/utils/regex_helper.py | 2 +- tests/admin_custom_urls/tests.py | 2 +- tests/admin_views/tests.py | 2 +- tests/backends/tests.py | 2 +- tests/basic/tests.py | 2 +- tests/delete/tests.py | 2 +- tests/file_uploads/tests.py | 2 +- tests/forms_tests/tests/test_extra.py | 2 +- tests/forms_tests/tests/test_fields.py | 2 +- tests/forms_tests/tests/test_formsets.py | 2 +- tests/i18n/test_extraction.py | 2 +- tests/m2m_signals/tests.py | 2 +- tests/migrations/test_state.py | 2 +- tests/model_fields/tests.py | 2 +- tests/model_formsets/tests.py | 2 +- tests/queries/tests.py | 2 +- tests/requests/tests.py | 2 +- tests/settings_tests/tests.py | 2 +- 26 files changed, 28 insertions(+), 28 deletions(-) diff --git a/django/contrib/auth/tests/test_hashers.py b/django/contrib/auth/tests/test_hashers.py index 10ab657ae5..0c280ae158 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 9d093bfa32..48d4aabf13 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 e5cefb0752..85dc1c139a 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 0dc4ce269d..31a2694421 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 5044fcfb6c..35cabba0cf 100644 --- a/django/db/backends/base/creation.py +++ b/django/db/backends/base/creation.py @@ -409,7 +409,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 51fb2783eb..d7ee805bb1 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 c39bf15453..8c5ee71819 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 1ec1398147..b7068e8c75 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -540,7 +540,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 a43234ad05..53736dffa7 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 f3182cd246..ea3c0704b3 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 0c28ecc029..a58474575e 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1783,7 +1783,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 3d4185e762..4a07cd5f2f 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -772,7 +772,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 3ba94d058d..72fdbaa8d8 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 2d6c02b9a9..c04284e069 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 130a3c7649..34681122e4 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 d172e17cd9..32f7e8cc04 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -390,7 +390,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 ea6e842475..c711360a50 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 94e27044ff..276bf1cb22 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 ad96f978bd..94948b203e 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 31a83212f5..ea4649551d 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 6410477b36..a7dbdbe11c 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 a9ce43cae6..1e30297f66 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 80c5c6fa09..acd05c9bf2 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 92e5982e10..c8d8532df3 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -1771,7 +1771,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 306e5e76bb..e9fdefb7ea 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 f1a43763b6..0befd18e29 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')