mirror of https://github.com/django/django.git
[1.11.x] Fixed spelling mistakes in code and comments.
Backport of 7d20094996
from master
This commit is contained in:
parent
246bece37a
commit
b7621bbe80
|
@ -137,8 +137,8 @@ class CursorWrapper(object):
|
|||
return self
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
# Ticket #17671 - Close instead of passing thru to avoid backend
|
||||
# specific behavior.
|
||||
# Close instead of passing through to avoid backend-specific behavior
|
||||
# (#17671).
|
||||
self.close()
|
||||
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ class CursorWrapper(object):
|
|||
return self
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
# Ticket #17671 - Close instead of passing thru to avoid backend
|
||||
# specific behavior. Catch errors liberally because errors in cleanup
|
||||
# code aren't useful.
|
||||
# Close instead of passing through to avoid backend-specific behavior
|
||||
# (#17671). Catch errors liberally because errors in cleanup code
|
||||
# aren't useful.
|
||||
try:
|
||||
self.close()
|
||||
except self.db.Database.Error:
|
||||
|
|
|
@ -59,7 +59,7 @@ class ColumnTypes(models.Model):
|
|||
file_path_field = models.FilePathField()
|
||||
float_field = models.FloatField()
|
||||
int_field = models.IntegerField()
|
||||
gen_ip_adress_field = models.GenericIPAddressField(protocol="ipv4")
|
||||
gen_ip_address_field = models.GenericIPAddressField(protocol="ipv4")
|
||||
pos_int_field = models.PositiveIntegerField()
|
||||
pos_small_int_field = models.PositiveSmallIntegerField()
|
||||
slug_field = models.SlugField()
|
||||
|
|
|
@ -70,9 +70,9 @@ class InspectDBTestCase(TestCase):
|
|||
assertFieldType('date_field', "models.DateField()")
|
||||
assertFieldType('date_time_field', "models.DateTimeField()")
|
||||
if connection.features.can_introspect_ip_address_field:
|
||||
assertFieldType('gen_ip_adress_field', "models.GenericIPAddressField()")
|
||||
assertFieldType('gen_ip_address_field', "models.GenericIPAddressField()")
|
||||
elif not connection.features.interprets_empty_strings_as_nulls:
|
||||
assertFieldType('gen_ip_adress_field', "models.CharField(max_length=39)")
|
||||
assertFieldType('gen_ip_address_field', "models.CharField(max_length=39)")
|
||||
if connection.features.can_introspect_time_field:
|
||||
assertFieldType('time_field', "models.TimeField()")
|
||||
if connection.features.has_native_uuid_field:
|
||||
|
|
|
@ -75,14 +75,14 @@ class ForeignKeyTests(TestCase):
|
|||
@isolate_apps('model_fields', 'model_fields.tests')
|
||||
def test_abstract_model_app_relative_foreign_key(self):
|
||||
class AbstractReferent(models.Model):
|
||||
reference = models.ForeignKey('Refered', on_delete=models.CASCADE)
|
||||
reference = models.ForeignKey('Referred', on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
app_label = 'model_fields'
|
||||
abstract = True
|
||||
|
||||
def assert_app_model_resolved(label):
|
||||
class Refered(models.Model):
|
||||
class Referred(models.Model):
|
||||
class Meta:
|
||||
app_label = label
|
||||
|
||||
|
@ -90,7 +90,7 @@ class ForeignKeyTests(TestCase):
|
|||
class Meta:
|
||||
app_label = label
|
||||
|
||||
self.assertEqual(ConcreteReferent._meta.get_field('reference').related_model, Refered)
|
||||
self.assertEqual(ConcreteReferent._meta.get_field('reference').related_model, Referred)
|
||||
|
||||
assert_app_model_resolved('model_fields')
|
||||
assert_app_model_resolved('tests')
|
||||
|
|
|
@ -39,19 +39,19 @@ class ManyToManyFieldTests(SimpleTestCase):
|
|||
@isolate_apps('model_fields', 'model_fields.tests')
|
||||
def test_abstract_model_app_relative_foreign_key(self):
|
||||
class AbstractReferent(models.Model):
|
||||
reference = models.ManyToManyField('Refered', through='Through')
|
||||
reference = models.ManyToManyField('Referred', through='Through')
|
||||
|
||||
class Meta:
|
||||
app_label = 'model_fields'
|
||||
abstract = True
|
||||
|
||||
def assert_app_model_resolved(label):
|
||||
class Refered(models.Model):
|
||||
class Referred(models.Model):
|
||||
class Meta:
|
||||
app_label = label
|
||||
|
||||
class Through(models.Model):
|
||||
refered = models.ForeignKey('Refered', on_delete=models.CASCADE)
|
||||
referred = models.ForeignKey('Referred', on_delete=models.CASCADE)
|
||||
referent = models.ForeignKey('ConcreteReferent', on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
|
@ -61,7 +61,7 @@ class ManyToManyFieldTests(SimpleTestCase):
|
|||
class Meta:
|
||||
app_label = label
|
||||
|
||||
self.assertEqual(ConcreteReferent._meta.get_field('reference').related_model, Refered)
|
||||
self.assertEqual(ConcreteReferent._meta.get_field('reference').related_model, Referred)
|
||||
self.assertEqual(ConcreteReferent.reference.through, Through)
|
||||
|
||||
assert_app_model_resolved('model_fields')
|
||||
|
|
|
@ -387,7 +387,7 @@ class ResolverTests(SimpleTestCase):
|
|||
A Resolver404 is raised if resolving doesn't meet the basic
|
||||
requirements of a path to match - i.e., at the very least, it matches
|
||||
the root pattern '^/'. Never return None from resolve() to prevent a
|
||||
TypeError from occuring later (#10834).
|
||||
TypeError from occurring later (#10834).
|
||||
"""
|
||||
with self.assertRaises(Resolver404):
|
||||
resolve('')
|
||||
|
|
Loading…
Reference in New Issue