diff options
| author | Honza Král <honza.kral@gmail.com> | 2009-07-05 13:30:17 +0000 |
|---|---|---|
| committer | Honza Král <honza.kral@gmail.com> | 2009-07-05 13:30:17 +0000 |
| commit | ff0eff055ea7cd28ba2856b89189d03dbe71c397 (patch) | |
| tree | 1282cb6bff47df8da2db595aadc5695e24131fb6 /tests | |
| parent | 0e3b83c31515c041e8a43736e7dd49ffd835b052 (diff) | |
[soc2009/model-validation] Added min and max length validator. CharField now validates it's value's length using a validator.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/validation/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/modeltests/validation/tests.py b/tests/modeltests/validation/tests.py index 95952a5a24..e6d1697ce2 100644 --- a/tests/modeltests/validation/tests.py +++ b/tests/modeltests/validation/tests.py @@ -39,6 +39,10 @@ class BaseModelValidationTests(ValidationTestCase): mtv = ModelToValidate(number=10, name='Some Name', email='valid@email.com') self.assertEqual(None, mtv.clean()) + def test_text_greater_that_charfields_max_length_eaises_erros(self): + mtv = ModelToValidate(number=10, name='Some Name'*100) + self.assertFailsValidation(mtv.clean, ['name',]) + class GetUniqueCheckTests(unittest.TestCase): def test_unique_fields_get_collected(self): m = UniqueFieldsModel() |
