1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fix many many typos in comments throughout the codebase

This commit is contained in:
Alex Gaynor
2014-04-26 10:18:45 -07:00
parent 8b5b199e20
commit 2bcb8bfc8d
53 changed files with 79 additions and 80 deletions

View File

@@ -409,7 +409,7 @@ class SystemChecksTestCase(TestCase):
def test_nonexistant_field(self):
class SongAdmin(admin.ModelAdmin):
readonly_fields = ("title", "nonexistant")
readonly_fields = ("title", "nonexistent")
errors = SongAdmin.check(model=Song)
expected = [

View File

@@ -385,7 +385,7 @@ class TestInlinePermissions(TestCase):
author = Author.objects.create(pk=1, name='The Author')
book = author.books.create(name='The inline Book')
self.author_change_url = '/admin/admin_inlines/author/%i/' % author.id
# Get the ID of the automatically created intermediate model for thw Author-Book m2m
# Get the ID of the automatically created intermediate model for the Author-Book m2m
author_book_auto_m2m_intermediate = Author.books.through.objects.get(author=author, book=book)
self.author_book_auto_m2m_intermediate_id = author_book_auto_m2m_intermediate.pk

View File

@@ -1564,7 +1564,7 @@ class Discovery(TestCase):
def test_precedence(self):
"""
Apps listed first in INSTALLED_APPS have precendence.
Apps listed first in INSTALLED_APPS have precedence.
"""
with self.settings(INSTALLED_APPS=['admin_scripts.complex_app',
'admin_scripts.simple_app',

View File

@@ -214,10 +214,10 @@ class ValidationTestCase(TestCase):
def test_nonexistant_field(self):
class SongAdmin(admin.ModelAdmin):
readonly_fields = ("title", "nonexistant")
readonly_fields = ("title", "nonexistent")
self.assertRaisesMessage(ImproperlyConfigured,
str_prefix("SongAdmin.readonly_fields[1], %(_)s'nonexistant' is not a callable "
str_prefix("SongAdmin.readonly_fields[1], %(_)s'nonexistent' is not a callable "
"or an attribute of 'SongAdmin' or found in the model 'Song'."),
SongAdmin.validate,
Song)

View File

@@ -420,7 +420,7 @@ class PostAdmin(admin.ModelAdmin):
if instance.pk:
return "%d amount of cool." % instance.pk
else:
return "Unkown coolness."
return "Unknown coolness."
def value(self, instance):
return 1000

View File

@@ -1045,8 +1045,8 @@ class AdminViewPermissionsTest(TestCase):
"""
Make sure only staff members can log in.
Successful posts to the login page will redirect to the orignal url.
Unsuccessfull attempts will continue to render the login page with
Successful posts to the login page will redirect to the original url.
Unsuccessful attempts will continue to render the login page with
a 200 status code.
"""
login_url = reverse('admin:login') + '?next=/test_admin/admin/'
@@ -3649,7 +3649,7 @@ class ReadonlyTest(TestCase):
self.assertContains(response,
"<label>Awesomeness level:</label>")
self.assertContains(response, "Very awesome.")
self.assertContains(response, "Unkown coolness.")
self.assertContains(response, "Unknown coolness.")
self.assertContains(response, "foo")
# Checks that multiline text in a readonly field gets <br /> tags

View File

@@ -91,6 +91,6 @@ class DataTypesTestCase(TestCase):
b = RumBaba.objects.create()
# Verify we didn't break DateTimeField behavior
self.assertIsInstance(b.baked_timestamp, datetime.datetime)
# We need to test this this way because datetime.datetime inherits
# We need to test this way because datetime.datetime inherits
# from datetime.date:
self.assertIsInstance(b.baked_date, datetime.date) and not isinstance(b.baked_date, datetime.datetime)

View File

@@ -112,7 +112,7 @@ class FieldDeconstructionTests(TestCase):
def test_decimal_field_0_decimal_places(self):
"""
A DecimalField with decimal_places=0 shoudl work (#22272).
A DecimalField with decimal_places=0 should work (#22272).
"""
field = models.DecimalField(max_digits=5, decimal_places=0)
name, path, args, kwargs = field.deconstruct()

View File

@@ -162,9 +162,9 @@ class FileUploadTests(TestCase):
response = self.client.request(**r)
# The filenames should have been sanitized by the time it got to the view.
recieved = json.loads(response.content.decode('utf-8'))
received = json.loads(response.content.decode('utf-8'))
for i, name in enumerate(scary_file_names):
got = recieved["file%s" % i]
got = received["file%s" % i]
self.assertEqual(got, "hax0rd.txt")
def test_filename_overflow(self):

View File

@@ -101,7 +101,7 @@ class PrimaryKeyCharModel(models.Model):
class FksToBooleans(models.Model):
"""Model wih FKs to models with {Null,}BooleanField's, #15040"""
"""Model with FKs to models with {Null,}BooleanField's, #15040"""
bf = models.ForeignKey(BooleanModel)
nbf = models.ForeignKey(NullBooleanModel)

View File

@@ -1844,7 +1844,7 @@ class FileAndImageFieldTests(TestCase):
@skipUnless(test_images, "Pillow not installed")
def test_image_field(self):
# ImageField and FileField are nearly identical, but they differ slighty when
# ImageField and FileField are nearly identical, but they differ slightly when
# it comes to validation. This specifically tests that #6302 is fixed for
# both file fields and image fields.

View File

@@ -258,7 +258,7 @@ class ModelInheritanceTest(TestCase):
self.assertEqual(m2mchildren, [])
# Ordering should not include any database column more than once (this
# is most likely to ocurr naturally with model inheritance, so we
# is most likely to occur naturally with model inheritance, so we
# check it here). Regression test for #9390. This necessarily pokes at
# the SQL string for the query, since the duplicate problems are only
# apparent at that late stage.
@@ -363,10 +363,10 @@ class ModelInheritanceTest(TestCase):
self.assertEqual(parties, [bachelor])
# Check that a subclass of a subclass of an abstract model doesn't get
# it's own accessor.
# its own accessor.
self.assertFalse(hasattr(p2, 'messybachelorparty_set'))
# ... but it does inherit the m2m from it's parent
# ... but it does inherit the m2m from its parent
messy = MessyBachelorParty.objects.create(
name='Bachelor party for Dave')
messy.attendees = [p4]

View File

@@ -2009,7 +2009,7 @@ class CloneTests(TestCase):
n_list = Note.objects.all()
# Evaluate the Note queryset, populating the query cache
list(n_list)
# Use the note queryset in a query, and evalute
# Use the note queryset in a query, and evaluate
# that query in a way that involves cloning.
self.assertEqual(ExtraInfo.objects.filter(note__in=n_list)[0].info, 'good')

View File

@@ -527,7 +527,7 @@ class SchemaTests(TransactionTestCase):
UniqueTest.objects.create(year=2011, slug="bar")
self.assertRaises(IntegrityError, UniqueTest.objects.create, year=2012, slug="foo")
UniqueTest.objects.all().delete()
# Alter the model to it's non-unique-together companion
# Alter the model to its non-unique-together companion
with connection.schema_editor() as editor:
editor.alter_unique_together(
UniqueTest,

View File

@@ -317,7 +317,7 @@ class SyndicationFeedTest(FeedTestCase):
Test that datetimes are correctly converted to the local time zone.
"""
# Naive date times passed in get converted to the local time zone, so
# check the recived zone offset against the local offset.
# check the received zone offset against the local offset.
response = self.client.get('/syndication/naive-dates/')
doc = minidom.parseString(response.content)
updated = doc.getElementsByTagName('updated')[0].firstChild.wholeText

View File

@@ -167,7 +167,7 @@ class SimpleTemplateResponseTest(TestCase):
self.assertEqual(unpickled_response['content-type'], response['content-type'])
self.assertEqual(unpickled_response.status_code, response.status_code)
# ...and the unpickled reponse doesn't have the
# ...and the unpickled response doesn't have the
# template-related attributes, so it can't be re-rendered
template_attrs = ('template_name', 'context_data', '_post_render_callbacks')
for attr in template_attrs:
@@ -273,7 +273,7 @@ class TemplateResponseTest(TestCase):
self.assertEqual(unpickled_response['content-type'], response['content-type'])
self.assertEqual(unpickled_response.status_code, response.status_code)
# ...and the unpickled reponse doesn't have the
# ...and the unpickled response doesn't have the
# template-related attributes, so it can't be re-rendered
template_attrs = ('template_name', 'context_data',
'_post_render_callbacks', '_request', '_current_app')

View File

@@ -717,7 +717,7 @@ class TemplateTests(TestCase):
'basic-syntax27': (r'{{ _("\"fred\"") }}', {}, "\"fred\""),
# regression test for ticket #12554
# make sure a silent_variable_failure Exception is supressed
# make sure a silent_variable_failure Exception is suppressed
# on dictionary and attribute lookup
'basic-syntax28': ("{{ a.b }}", {'a': SilentGetItemClass()}, ('', 'INVALID')),
'basic-syntax29': ("{{ a.b }}", {'a': SilentAttrClass()}, ('', 'INVALID')),

View File

@@ -88,7 +88,7 @@ TEST_DATA = (
(validate_ipv4_address, '25.1 .1.1', ValidationError),
# validate_ipv6_address uses django.utils.ipv6, which
# is tested in much greater detail in it's own testcase
# is tested in much greater detail in its own testcase
(validate_ipv6_address, 'fe80::1', None),
(validate_ipv6_address, '::1', None),
(validate_ipv6_address, '1:2:3:4:5:6:7:8', None),