mirror of
https://github.com/django/django.git
synced 2025-07-18 08:39:15 +00:00
[1.0.X] Make sure that all uses of max_length in the test suite use values smaller than 255. If we use max_length > 255 the test suite can't be run on MySQL 4. Backport of [10697] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6a080b199c
commit
899d484afb
@ -10,7 +10,7 @@ class BoundaryModel(models.Model):
|
||||
positive_integer = models.PositiveIntegerField(null=True, blank=True)
|
||||
|
||||
class Defaults(models.Model):
|
||||
name = models.CharField(max_length=256, default='class default value')
|
||||
name = models.CharField(max_length=255, default='class default value')
|
||||
def_date = models.DateField(default = datetime.date(1980, 1, 1))
|
||||
value = models.IntegerField(default=42)
|
||||
|
||||
|
@ -7,7 +7,7 @@ class PersonWithDefaultMaxLengths(models.Model):
|
||||
avatar = models.FilePathField()
|
||||
|
||||
class PersonWithCustomMaxLengths(models.Model):
|
||||
email = models.EmailField(max_length=384)
|
||||
vcard = models.FileField(upload_to='/tmp', max_length=1024)
|
||||
homepage = models.URLField(max_length=256)
|
||||
avatar = models.FilePathField(max_length=512)
|
||||
email = models.EmailField(max_length=250)
|
||||
vcard = models.FileField(upload_to='/tmp', max_length=250)
|
||||
homepage = models.URLField(max_length=250)
|
||||
avatar = models.FilePathField(max_length=250)
|
||||
|
@ -14,10 +14,10 @@ class MaxLengthArgumentsTests(TestCase):
|
||||
self.verify_max_length(PersonWithDefaultMaxLengths, 'avatar', 100)
|
||||
|
||||
def test_custom_max_lengths(self):
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'email', 384)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'vcard', 1024)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'homepage', 256)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'avatar', 512)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'email', 250)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'vcard', 250)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'homepage', 250)
|
||||
self.verify_max_length(PersonWithCustomMaxLengths, 'avatar', 250)
|
||||
|
||||
class MaxLengthORMTests(TestCase):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user