diff options
| author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2014-03-02 15:25:53 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-03-03 07:38:09 -0500 |
| commit | 0d912258921a442c48d5787228db2db5af7e8fa5 (patch) | |
| tree | f6826425de5bca2498c46e5242b870282a34eda2 /tests | |
| parent | 6acaa5238668593d6d854b28dbfa65e95796585c (diff) | |
Fixed many typos in comments and docstrings.
Thanks Piotr Kasprzyk for help with the patch.
Diffstat (limited to 'tests')
42 files changed, 79 insertions, 79 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index ca889f0648..431999d6d0 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -191,7 +191,7 @@ class ChangeListTests(TestCase): def test_distinct_for_m2m_in_list_filter(self): """ Regression test for #13902: When using a ManyToMany in list_filter, - results shouldn't apper more than once. Basic ManyToMany. + results shouldn't appear more than once. Basic ManyToMany. """ blues = Genre.objects.create(name='Blues') band = Band.objects.create(name='B.B. King Review', nr_of_members=11) @@ -215,7 +215,7 @@ class ChangeListTests(TestCase): def test_distinct_for_through_m2m_in_list_filter(self): """ Regression test for #13902: When using a ManyToMany in list_filter, - results shouldn't apper more than once. With an intermediate model. + results shouldn't appear more than once. With an intermediate model. """ lead = Musician.objects.create(name='Vox') band = Group.objects.create(name='The Hype') @@ -238,7 +238,7 @@ class ChangeListTests(TestCase): def test_distinct_for_inherited_m2m_in_list_filter(self): """ Regression test for #13902: When using a ManyToMany in list_filter, - results shouldn't apper more than once. Model managed in the + results shouldn't appear more than once. Model managed in the admin inherits from the one that defins the relationship. """ lead = Musician.objects.create(name='John') @@ -262,7 +262,7 @@ class ChangeListTests(TestCase): def test_distinct_for_m2m_to_inherited_in_list_filter(self): """ Regression test for #13902: When using a ManyToMany in list_filter, - results shouldn't apper more than once. Target of the relationship + results shouldn't appear more than once. Target of the relationship inherits from another. """ lead = ChordsMusician.objects.create(name='Player A') diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 4ef584f3de..2f3fdfdf6c 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -63,7 +63,7 @@ class TestInline(TestCase): def test_inline_primary(self): person = Person.objects.create(firstname='Imelda') item = OutfitItem.objects.create(name='Shoes') - # Imelda likes shoes, but can't cary her own bags. + # Imelda likes shoes, but can't carry her own bags. data = { 'shoppingweakness_set-TOTAL_FORMS': 1, 'shoppingweakness_set-INITIAL_FORMS': 0, @@ -91,7 +91,7 @@ class TestInline(TestCase): 'title_set-0-title2': 'a different title', } response = self.client.post('/admin/admin_inlines/titlecollection/add/', data) - # Here colspan is "4": two fields (title1 and title2), one hidden field and the delete checkbock. + # Here colspan is "4": two fields (title1 and title2), one hidden field and the delete checkbox. self.assertContains(response, '<tr><td colspan="4"><ul class="errorlist"><li>The two titles must be the same</li></ul></td></tr>') def test_no_parent_callable_lookup(self): @@ -109,7 +109,7 @@ class TestInline(TestCase): self.assertEqual(response.status_code, 200) # Add parent object view should have the child inlines section self.assertContains(response, '<div class="inline-group" id="question_set-group">') - # The right callabe should be used for the inline readonly_fields + # The right callable should be used for the inline readonly_fields # column cells self.assertContains(response, '<p>Callable in QuestionInline</p>') diff --git a/tests/admin_ordering/tests.py b/tests/admin_ordering/tests.py index acd1a5ccdb..7a6efb0b4d 100644 --- a/tests/admin_ordering/tests.py +++ b/tests/admin_ordering/tests.py @@ -58,7 +58,7 @@ class TestAdminOrdering(TestCase): def test_dynamic_ordering(self): """ - Let's use a custom ModelAdmin that changes the ordering dinamically. + Let's use a custom ModelAdmin that changes the ordering dynamically. """ super_user = User.objects.create(username='admin', is_superuser=True) other_user = User.objects.create(username='other') diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index af6aa92754..289f0bdd65 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals """ -A series of tests to establish that the command-line managment tools work as +A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ @@ -1474,7 +1474,7 @@ class CommandTypes(AdminScriptTestCase): def test_run_from_argv_non_ascii_error(self): """ - Test that non-ascii message of CommandError does not raise any + Test that non-ASCII message of CommandError does not raise any UnicodeDecodeError in run_from_argv. """ def raise_command_error(*args, **kwargs): diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 5e4edf6909..c39e99aa1b 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -249,7 +249,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase): def testChangeListSortingModel(self): """ Ensure we can sort on a list_display field that is a Model method - (colunn 3 is 'model_year' in ArticleAdmin) + (column 3 is 'model_year' in ArticleAdmin) """ response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'o': '-3'}) self.assertContentBefore(response, 'Newest content', 'Middle content', @@ -729,7 +729,7 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase): group = Group.objects.create(name="foogroup") post_data = { 'action': 'delete_selected', - 'selected_accross': '0', + 'selected_across': '0', 'index': '0', '_selected_action': group.id } @@ -1185,7 +1185,7 @@ class AdminViewPermissionsTest(TestCase): 'date_0': '2008-03-18', 'date_1': '10:54:39', 'section': 1} - # add user shoud not be able to view the list of article or change any of them + # add user should not be able to view the list of article or change any of them self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/') @@ -1259,7 +1259,7 @@ class AdminViewPermissionsTest(TestCase): login_url = reverse('admin:login') + '?next=/test_admin/admin/' - # add user shoud not be able to view the list of article or change any of them + # add user should not be able to view the list of article or change any of them self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/1/history/') @@ -1366,7 +1366,7 @@ class AdminViewPermissionsTest(TestCase): login_url = reverse('admin:login') + '?next=/test_admin/admin/' delete_dict = {'post': 'yes'} - # add user shoud not be able to delete articles + # add user should not be able to delete articles self.client.get('/test_admin/admin/') self.client.post(login_url, self.adduser_login) response = self.client.get('/test_admin/admin/admin_views/article/1/delete/') @@ -1749,7 +1749,7 @@ class AdminViewStringPrimaryKeyTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SecureViewTests(TestCase): """ - Test behaviour of a view protected by the staff_member_required decorator. + Test behavior of a view protected by the staff_member_required decorator. """ urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] @@ -1782,7 +1782,7 @@ class AdminViewUnicodeTest(TestCase): def testUnicodeEdit(self): """ - A test to ensure that POST on edit_view handles non-ascii characters. + A test to ensure that POST on edit_view handles non-ASCII characters. """ post_data = { "name": "Test lærdommer", @@ -1815,7 +1815,7 @@ class AdminViewUnicodeTest(TestCase): def testUnicodeDelete(self): """ - Ensure that the delete_view handles non-ascii characters + Ensure that the delete_view handles non-ASCII characters """ delete_dict = {'post': 'yes'} response = self.client.get('/test_admin/admin/admin_views/book/1/delete/') @@ -3995,7 +3995,7 @@ class CSSTest(TestCase): def testAppModelInFormBodyClass(self): """ - Ensure app and model tag are correcly read by change_form template + Ensure app and model tag are correctly read by change_form template """ response = self.client.get('/test_admin/admin/admin_views/section/add/') self.assertEqual(response.status_code, 200) @@ -4004,7 +4004,7 @@ class CSSTest(TestCase): def testAppModelInListBodyClass(self): """ - Ensure app and model tag are correcly read by change_list template + Ensure app and model tag are correctly read by change_list template """ response = self.client.get('/test_admin/admin/admin_views/section/') self.assertEqual(response.status_code, 200) @@ -4013,7 +4013,7 @@ class CSSTest(TestCase): def testAppModelInDeleteConfirmationBodyClass(self): """ - Ensure app and model tag are correcly read by delete_confirmation + Ensure app and model tag are correctly read by delete_confirmation template """ response = self.client.get( @@ -4024,7 +4024,7 @@ class CSSTest(TestCase): def testAppModelInAppIndexBodyClass(self): """ - Ensure app and model tag are correcly read by app_index template + Ensure app and model tag are correctly read by app_index template """ response = self.client.get('/test_admin/admin/admin_views/') self.assertEqual(response.status_code, 200) @@ -4032,7 +4032,7 @@ class CSSTest(TestCase): def testAppModelInDeleteSelectedConfirmationBodyClass(self): """ - Ensure app and model tag are correcly read by + Ensure app and model tag are correctly read by delete_selected_confirmation template """ action_data = { @@ -4719,7 +4719,7 @@ class AdminViewOnSiteTests(TestCase): ) def test_true(self): - "Ensure that the default behaviour is followed if view_on_site is True" + "Ensure that the default behavior is followed if view_on_site is True" response = self.client.get('/test_admin/admin/admin_views/city/1/') content_type_pk = ContentType.objects.get_for_model(City).pk self.assertContains(response, diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index dc3d3e2e46..9fce51059b 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -70,7 +70,7 @@ class AggregationTests(TestCase): Regression test for #11916: Extra params + aggregation creates incorrect SQL. """ - # oracle doesn't support subqueries in group by clause + # Oracle doesn't support subqueries in group by clause shortest_book_sql = """ SELECT name FROM aggregation_regress_book b @@ -1080,7 +1080,7 @@ class AggregationTests(TestCase): ) def test_name_expressions(self): - # Test that aggregates are spotted corretly from F objects. + # Test that aggregates are spotted correctly from F objects. # Note that Adrian's age is 34 in the fixtures, and he has one book # so both conditions match one author. qs = Author.objects.annotate(Count('book')).filter( diff --git a/tests/backends/tests.py b/tests/backends/tests.py index d5116898ec..eaded5dbae 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -563,14 +563,14 @@ class BackendTestCase(TestCase): @skipUnlessDBFeature('supports_paramstyle_pyformat') def test_cursor_execute_with_pyformat(self): - #10070: Support pyformat style passing of paramters + #10070: Support pyformat style passing of parameters args = {'root': 3, 'square': 9} self.create_squares(args, 'pyformat', multiple=False) self.assertEqual(models.Square.objects.count(), 1) @skipUnlessDBFeature('supports_paramstyle_pyformat') def test_cursor_executemany_with_pyformat(self): - #10070: Support pyformat style passing of paramters + #10070: Support pyformat style passing of parameters args = [{'root': i, 'square': i ** 2} for i in range(-5, 6)] self.create_squares(args, 'pyformat', multiple=True) self.assertEqual(models.Square.objects.count(), 11) @@ -733,7 +733,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 try: @@ -751,7 +751,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 try: @@ -768,7 +768,7 @@ class FkConstraintsTests(TransactionTestCase): with transaction.atomic(): # Create an Article. models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r) - # Retrive it from the DB + # Retrieve it from the DB a = models.Article.objects.get(headline="Test article") a.reporter_id = 30 with connection.constraint_checks_disabled(): diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 976fb1124d..7b1f78a3b6 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -871,7 +871,7 @@ class SelectOnSaveTests(TestCase): with self.assertNumQueries(2): asos.save() self.assertTrue(FakeQuerySet.called) - # This is not wanted behaviour, but this is how Django has always + # This is not wanted behavior, but this is how Django has always # behaved for databases that do not return correct information # about matched rows for UPDATE. with self.assertRaises(DatabaseError): diff --git a/tests/cache/tests.py b/tests/cache/tests.py index f5d213e759..8c7fbc6d45 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -1292,7 +1292,7 @@ class CacheUtils(TestCase): def test_cache_key_varies_by_url(self): """ - get_cache_key keys differ by fully-qualfied URL instead of path + get_cache_key keys differ by fully-qualified URL instead of path """ request1 = self.factory.get(self.path, HTTP_HOST='sub-1.example.com') learn_cache_key(request1, HttpResponse()) diff --git a/tests/defer/tests.py b/tests/defer/tests.py index 266a851ffe..43a088f3e2 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -110,7 +110,7 @@ class DeferTests(TestCase): obj.name = "c2" obj.save() - # You can retrive a single column on a base class with no fields + # You can retrieve a single column on a base class with no fields obj = Child.objects.only("name").get(name="c2") self.assert_delayed(obj, 3) self.assertEqual(obj.name, "c2") diff --git a/tests/extra_regress/tests.py b/tests/extra_regress/tests.py index 4eaecc19af..8749cb8ebf 100644 --- a/tests/extra_regress/tests.py +++ b/tests/extra_regress/tests.py @@ -131,7 +131,7 @@ class ExtraRegressTests(TestCase): """ Regression test for #8039: Ordering sometimes removed relevant tables from extra(). This test is the critical case: ordering uses a table, - but then removes the reference because of an optimisation. The table + but then removes the reference because of an optimization. The table should still be present because of the extra() call. """ self.assertQuerysetEqual( diff --git a/tests/field_subclassing/fields.py b/tests/field_subclassing/fields.py index e9c7a982e8..43ece22e82 100644 --- a/tests/field_subclassing/fields.py +++ b/tests/field_subclassing/fields.py @@ -59,7 +59,7 @@ class SmallerField(SmallField): class JSONField(six.with_metaclass(models.SubfieldBase, models.TextField)): - description = ("JSONField automatically serializes and desializes values to " + description = ("JSONField automatically serializes and deserializes values to " "and from JSON.") def to_python(self, value): diff --git a/tests/field_subclassing/tests.py b/tests/field_subclassing/tests.py index 3045f7d226..6a3d1cad20 100644 --- a/tests/field_subclassing/tests.py +++ b/tests/field_subclassing/tests.py @@ -39,7 +39,7 @@ class CustomField(TestCase): # Custom fields still have normal field's attributes. self.assertEqual(m._meta.get_field("data").verbose_name, "small field") - # The m.data attribute has been initialised correctly. It's a Small + # The m.data attribute has been initialized correctly. It's a Small # object. self.assertEqual((m.data.first, m.data.second), (1, 2)) @@ -100,7 +100,7 @@ class CustomField(TestCase): http://users.rcn.com/python/download/Descriptor.htm#properties """ # Even when looking for totally different properties, SubfieldBase's - # non property like behaviour made inspect crash. Refs #12568. + # non property like behavior made inspect crash. Refs #12568. data = dict(inspect.getmembers(MyModel)) self.assertIn('__module__', data) self.assertEqual(data['__module__'], 'field_subclassing.models') diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index ae2076c5e4..4ffba851eb 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -341,7 +341,7 @@ class FileStorageTests(unittest.TestCase): def test_file_chunks_error(self): """ - Test behaviour when file.chunks() is raising an error + Test behavior when file.chunks() is raising an error """ f1 = ContentFile('chunks fails') diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py index a964ae79d7..88eadae6b9 100644 --- a/tests/fixtures/tests.py +++ b/tests/fixtures/tests.py @@ -304,7 +304,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): ]) def test_ambiguous_compressed_fixture(self): - # The name "fixture5" is ambigous, so loading it will raise an error + # The name "fixture5" is ambiguous, so loading it will raise an error with self.assertRaises(management.CommandError) as cm: management.call_command('loaddata', 'fixture5', verbosity=0) self.assertIn("Multiple fixtures named 'fixture5'", cm.exception.args[0]) diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 6984db30c6..61fc66d928 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -64,7 +64,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_not_ignore(self): """ Test for ticket #9279 -- Error is raised for entries in - the serialised data for fields that have been removed + the serialized data for fields that have been removed from the database when not ignored. """ with self.assertRaises(DeserializationError): @@ -77,7 +77,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_ignore(self): """ Test for ticket #9279 -- Ignores entries in - the serialised data for fields that have been removed + the serialized data for fields that have been removed from the database. """ management.call_command( @@ -90,7 +90,7 @@ class TestFixtures(TestCase): def test_loaddata_not_found_fields_ignore_xml(self): """ - Test for ticket #19998 -- Ignore entries in the XML serialised data + Test for ticket #19998 -- Ignore entries in the XML serialized data for fields that have been removed from the model definition. """ management.call_command( diff --git a/tests/foreign_object/models.py b/tests/foreign_object/models.py index 5ec6f6d28b..fc51118149 100644 --- a/tests/foreign_object/models.py +++ b/tests/foreign_object/models.py @@ -113,7 +113,7 @@ class ArticleTranslationDescriptor(ReverseSingleRelatedObjectDescriptor): class ColConstraint(object): - # Antyhing with as_sql() method works in get_extra_restriction(). + # Anything with as_sql() method works in get_extra_restriction(). def __init__(self, alias, col, value): self.alias, self.col, self.value = alias, col, value diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index 100c655117..f74a6a08b2 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -510,7 +510,7 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin): self.assertFormErrors(['This is not a valid IPv6 address.'], f.clean, '1:2') def test_generic_ipaddress_normalization(self): - # Test the normalising code + # Test the normalizing code f = GenericIPAddressField() self.assertEqual(f.clean(' ::ffff:0a0a:0a0a '), '::ffff:10.10.10.10') self.assertEqual(f.clean(' ::ffff:10.10.10.10 '), '::ffff:10.10.10.10') diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index f06a31f393..c05c79a68e 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -1710,7 +1710,7 @@ class FormsTestCase(TestCase): def test_empty_permitted(self): # Sometimes (pretty much in formsets) we want to allow a form to pass validation # if it is completely empty. We can accomplish this by using the empty_permitted - # agrument to a form constructor. + # argument to a form constructor. class SongForm(Form): artist = CharField() name = CharField() diff --git a/tests/generic_views/urls.py b/tests/generic_views/urls.py index 8b2560b0f9..1ecc0ec898 100644 --- a/tests/generic_views/urls.py +++ b/tests/generic_views/urls.py @@ -164,7 +164,7 @@ urlpatterns = patterns('', views.AuthorListCustomPaginator.as_view()), # YearArchiveView - # Mixing keyword and possitional captures below is intentional; the views + # Mixing keyword and positional captures below is intentional; the views # ought to be able to accept either. (r'^dates/books/(?P<year>\d{4})/$', views.BookYearArchive.as_view()), diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index bd18700076..f0a7b35fae 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -100,7 +100,7 @@ class ExtractorTests(SimpleTestCase): return self._assertPoLocComment(True, po_filename, line_number, *comment_parts) def assertLocationCommentNotPresent(self, po_filename, line_number, *comment_parts): - """Check the oposite of assertLocationComment()""" + """Check the opposite of assertLocationComment()""" return self._assertPoLocComment(False, po_filename, line_number, *comment_parts) diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index 794ed6fd77..6c5ede7c61 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -44,7 +44,7 @@ class InspectDBTestCase(TestCase): return assertFieldType - # Inspecting oracle DB doesn't produce correct results, see #19884 + # Inspecting Oracle DB doesn't produce correct results, see #19884 @expectedFailureOnOracle def test_field_types(self): """Test introspection of various Django field types""" @@ -163,7 +163,7 @@ class InspectDBTestCase(TestCase): self.assertIn("field_field_1 = models.IntegerField(db_column='__field')", output) self.assertIn("prc_x = models.IntegerField(db_column='prc(%) x')", output) if PY3: - # Python 3 allows non-ascii identifiers + # Python 3 allows non-ASCII identifiers self.assertIn("tamaño = models.IntegerField()", output) else: self.assertIn("tama_o = models.IntegerField(db_column='tama\\xf1o')", output) diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index f5e0b744de..df6192ee11 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -628,7 +628,7 @@ class LookupTests(TestCase): def test_regex_non_ascii(self): """ - Ensure that a regex lookup does not trip on non-ascii characters. + Ensure that a regex lookup does not trip on non-ASCII characters. """ Player.objects.create(name='\u2660') Player.objects.get(name__regex='\u2660') diff --git a/tests/m2m_recursive/tests.py b/tests/m2m_recursive/tests.py index fe13b27239..8ab86aaaee 100644 --- a/tests/m2m_recursive/tests.py +++ b/tests/m2m_recursive/tests.py @@ -168,12 +168,12 @@ class RecursiveM2MTests(TestCase): attrgetter("name"), ordered=False ) - # As the assertQuerysetEqual uses a set for comparrison, + # As the assertQuerysetEqual uses a set for comparison, # check we've only got David listed once self.assertEqual(self.a.idols.all().count(), 1) def test_recursive_m2m_related_to_self(self): - """ Check the expected behaviour when an instance is related to itself """ + """ Check the expected behavior when an instance is related to itself """ # Ann idolizes herself self.a.idols.add(self.a) diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 935508aa16..5912d94efb 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -39,7 +39,7 @@ class HeadersCheckMixin(object): Check that :param message: has all :param headers: headers. :param message: can be an instance of an email.Message subclass or a - string with the contens of an email message. + string with the contents of an email message. :param headers: should be a set of (header-name, header-value) tuples. """ if isinstance(message, binary_type): @@ -103,7 +103,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): def test_space_continuation(self): """ - Test for space continuation character in long (ascii) subject headers (#7747) + Test for space continuation character in long (ASCII) subject headers (#7747) """ email = EmailMessage('Long subject lines that get wrapped should contain a space continuation character to get expected behavior in Outlook and Thunderbird', 'Content', 'from@example.com', ['to@example.com']) message = email.message() @@ -630,7 +630,7 @@ class BaseEmailBackendTests(HeadersCheckMixin, object): def test_close_connection(self): """ - Test that connection can be closed (even when not explicitely opened) + Test that connection can be closed (even when not explicitly opened) """ conn = mail.get_connection(username='', password='') try: diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 54c13dd0ee..f9d1a76078 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -300,7 +300,7 @@ class BooleanFieldTests(unittest.TestCase): old_default = boolean_field.default try: boolean_field.default = NOT_PROVIDED - # check patch was succcessful + # check patch was successful self.assertFalse(boolean_field.has_default()) b = BooleanModel() self.assertIsNone(b.bfield) diff --git a/tests/model_forms_regress/tests.py b/tests/model_forms_regress/tests.py index d6c05f3153..2d115f515b 100644 --- a/tests/model_forms_regress/tests.py +++ b/tests/model_forms_regress/tests.py @@ -285,7 +285,7 @@ class OneToOneFieldTests(TestCase): self.assertEqual(form.cleaned_data['publication'], None) author = form.save() # author object returned from form still retains original publication object - # that's why we need to retreive it from database again + # that's why we need to retrieve it from database again new_author = Author.objects.get(pk=author.pk) self.assertEqual(new_author.publication, None) diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py index b631018828..952ba45aab 100644 --- a/tests/model_regress/tests.py +++ b/tests/model_regress/tests.py @@ -140,7 +140,7 @@ class ModelTests(TestCase): def test_date_filter_null(self): # Date filtering was failing with NULL date values in SQLite - # (regression test for #3501, amongst other things). + # (regression test for #3501, among other things). Party.objects.create(when=datetime.datetime(1999, 1, 1)) Party.objects.create() p = Party.objects.filter(when__month=1)[0] diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py index fb46023502..f6a250db09 100644 --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -127,7 +127,7 @@ class ModelAdminTests(TestCase): def test_field_arguments_restricted_on_form(self): # If we specify fields or fieldsets, it should exclude fields on the Form class # to the fields specified. This may cause errors to be raised in the db layer if - # required model fields arent in fields/fieldsets, but that's preferable to + # required model fields aren't in fields/fieldsets, but that's preferable to # ghost errors where you have a field in your Form class that isn't being # displayed because you forgot to add it to fields/fieldsets diff --git a/tests/multiple_database/tests.py b/tests/multiple_database/tests.py index 8ffe00578b..8f3ff29dcf 100644 --- a/tests/multiple_database/tests.py +++ b/tests/multiple_database/tests.py @@ -182,7 +182,7 @@ class QueryTestCase(TestCase): dive = Book.objects.using('other').get(title="Dive into Python") mark = Person.objects.using('other').get(name="Mark Pilgrim") - # Retrive related object by descriptor. Related objects should be database-baound + # Retrieve related object by descriptor. Related objects should be database-bound self.assertEqual(list(dive.authors.all().values_list('name', flat=True)), ['Mark Pilgrim']) @@ -397,7 +397,7 @@ class QueryTestCase(TestCase): chris = Person.objects.using('other').create(name="Chris Mills") - # Save the author's favourite books + # Save the author's favorite books pro.editor = george pro.save() @@ -425,7 +425,7 @@ class QueryTestCase(TestCase): chris = Person.objects.using('other').get(name="Chris Mills") dive = Book.objects.using('other').get(title="Dive into Python") - # Retrive related object by descriptor. Related objects should be database-baound + # Retrieve related object by descriptor. Related objects should be database-bound self.assertEqual(list(chris.edited.values_list('title', flat=True)), ['Dive into Python']) @@ -620,7 +620,7 @@ class QueryTestCase(TestCase): alice_profile = UserProfile.objects.using('default').get(flavor='chocolate') bob_profile = UserProfile.objects.using('other').get(flavor='crunchy frog') - # Retrive related object by descriptor. Related objects should be database-baound + # Retrieve related object by descriptor. Related objects should be database-bound self.assertEqual(alice_profile.user.username, 'alice') self.assertEqual(bob_profile.user.username, 'bob') @@ -721,7 +721,7 @@ class QueryTestCase(TestCase): # Reget the objects to clear caches dive = Book.objects.using('other').get(title="Dive into Python") - # Retrive related object by descriptor. Related objects should be database-bound + # Retrieve related object by descriptor. Related objects should be database-bound self.assertEqual(list(dive.reviews.all().values_list('source', flat=True)), ['Python Weekly']) diff --git a/tests/mutually_referential/models.py b/tests/mutually_referential/models.py index 25bc45731f..230a1ec237 100644 --- a/tests/mutually_referential/models.py +++ b/tests/mutually_referential/models.py @@ -11,11 +11,11 @@ class Parent(models.Model): name = models.CharField(max_length=100) # Use a simple string for forward declarations. - bestchild = models.ForeignKey("Child", null=True, related_name="favoured_by") + bestchild = models.ForeignKey("Child", null=True, related_name="favored_by") class Child(models.Model): name = models.CharField(max_length=100) - # You can also explicitally specify the related app. + # You can also explicitly specify the related app. parent = models.ForeignKey("mutually_referential.Parent") diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index 000ef0450a..c2ad54c5ad 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -286,7 +286,7 @@ class ModelPaginationTests(TestCase): def test_page_getitem(self): """ - Tests proper behaviour of a paginator page __getitem__ (queryset + Tests proper behavior of a paginator page __getitem__ (queryset evaluation, slicing, exception raised). """ paginator = Paginator(Article.objects.all(), 5) diff --git a/tests/queries/models.py b/tests/queries/models.py index b38f672ea6..1083968d41 100644 --- a/tests/queries/models.py +++ b/tests/queries/models.py @@ -153,7 +153,7 @@ class Number(models.Model): def __str__(self): return six.text_type(self.num) -# Symmetrical m2m field with a normal field using the reverse accesor name +# Symmetrical m2m field with a normal field using the reverse accessor name # ("valid"). diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 7bb5bb34d0..a21b19a100 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -942,7 +942,7 @@ class Queries1Tests(BaseQuerysetTest): def test_ticket_10790_2(self): # Querying across several tables should strip only the last outer join, - # while preserving the preceeding inner joins. + # while preserving the preceding inner joins. q = Tag.objects.filter(parent__parent__isnull=False) self.assertQuerysetEqual( @@ -2266,7 +2266,7 @@ class ConditionalTests(BaseQuerysetTest): # for the related field). self.assertEqual(len(Tag.objects.order_by('parent')), 5) - # ... but you can still order in a non-recursive fashion amongst linked + # ... but you can still order in a non-recursive fashion among linked # fields (the previous test failed because the default ordering was # recursive). self.assertQuerysetEqual( diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py index 73f8b9d7c9..17479df6cd 100644 --- a/tests/raw_query/tests.py +++ b/tests/raw_query/tests.py @@ -229,7 +229,7 @@ class RawQueryTests(TestCase): def test_inheritance(self): # date is the end of the Cuban Missile Crisis, I have no idea when - # Wesley was bron + # Wesley was born f = FriendlyAuthor.objects.create(first_name="Wesley", last_name="Chun", dob=date(1962, 10, 28)) query = "SELECT * FROM raw_query_friendlyauthor" diff --git a/tests/servers/tests.py b/tests/servers/tests.py index 8f8a310c71..6e31da340a 100644 --- a/tests/servers/tests.py +++ b/tests/servers/tests.py @@ -140,7 +140,7 @@ class LiveServerViews(LiveServerBase): def test_no_collectstatic_emulation(self): """ Test that LiveServerTestCase reports a 404 status code when HTTP client - tries to access a static file that isn't explictly put under + tries to access a static file that isn't explicitly put under STATIC_ROOT. """ try: diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 174ac241d3..754fdd32ab 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -291,7 +291,7 @@ class TestComplexSettingOverride(TestCase): self.assertEqual(os.path.splitext(w[0].filename)[0], os.path.splitext(__file__)[0]) self.assertEqual(str(w[0].message), - 'Overriding setting TEST_WARN can lead to unexpected behaviour.') + 'Overriding setting TEST_WARN can lead to unexpected behavior.') class TrailingSlashURLTests(TestCase): diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py index f89b9803e4..d2227878f0 100644 --- a/tests/template_tests/test_loaders.py +++ b/tests/template_tests/test_loaders.py @@ -117,7 +117,7 @@ class EggLoaderTest(TestCase): class CachedLoader(TestCase): def test_templatedir_caching(self): "Check that the template directories form part of the template cache key. Refs #13573" - # Retrive a template specifying a template directory to check + # Retrieve a template specifying a template directory to check t1, name = loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'first'),)) # Now retrieve the same template name, but from a different directory t2, name = loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'second'),)) diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 1a0e0d4456..cfe2b5b480 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -233,7 +233,7 @@ class TemplateLoaderTests(TestCase): self.assertTrue(template_name.endswith(load_name), 'Template loaded by filesystem loader has incorrect name for debug page: %s' % template_name) - # Aso test the cached loader, since it overrides load_template + # Also test the cached loader, since it overrides load_template cache_loader = cached.Loader(('',)) cache_loader._cached_loaders = loader.template_source_loaders loader.template_source_loaders = (cache_loader,) diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py index 0d026971fe..80a2cb8e54 100644 --- a/tests/test_runner/tests.py +++ b/tests/test_runner/tests.py @@ -268,7 +268,7 @@ class Sqlite3InMemoryTestDbs(TestCase): other = db.connections['other'] runner.DiscoverRunner(verbosity=0).setup_databases() msg = "DATABASES setting '%s' option set to sqlite3's ':memory:' value shouldn't interfere with transaction support detection." % option - # Transaction support should be properly initialised for the 'other' DB + # Transaction support should be properly initialized for the 'other' DB self.assertTrue(other.features.supports_transactions, msg) # And all the DBs should report that they support transactions self.assertTrue(connections_support_transactions(), msg) diff --git a/tests/transactions_regress/tests.py b/tests/transactions_regress/tests.py index 1f9f291307..e3cc2bc73c 100644 --- a/tests/transactions_regress/tests.py +++ b/tests/transactions_regress/tests.py @@ -199,7 +199,7 @@ class TestTransactionClosing(IgnoreDeprecationWarningsMixin, TransactionTestCase "Cannot establish two connections to an in-memory SQLite database.") class TestNewConnection(IgnoreDeprecationWarningsMixin, TransactionTestCase): """ - Check that new connections don't have special behaviour. + Check that new connections don't have special behavior. """ available_apps = ['transactions_regress'] diff --git a/tests/view_tests/generic_urls.py b/tests/view_tests/generic_urls.py index a228290424..4d6a2219ec 100644 --- a/tests/view_tests/generic_urls.py +++ b/tests/view_tests/generic_urls.py @@ -35,7 +35,7 @@ urlpatterns = patterns('', url('^中文/target/$', 'view_tests.views.index_page'), ) -# rediriects, both temporary and permanent, with non-ASCII targets +# redirects, both temporary and permanent, with non-ASCII targets urlpatterns += patterns('', ('^nonascii_redirect/$', RedirectView.as_view( url='/中文/target/', permanent=False)), |
