diff options
| author | Chris Beaven <smileychris@gmail.com> | 2011-09-09 22:32:38 +0000 |
|---|---|---|
| committer | Chris Beaven <smileychris@gmail.com> | 2011-09-09 22:32:38 +0000 |
| commit | fe88584589922c1a0e068f18c82fe1b17e437fcd (patch) | |
| tree | 1649dec9b4128ba8d883b63e4bcf33ee9808e87c /tests/regressiontests/forms | |
| parent | 699688dc2cfad627c5d400c6bdb681c81e932bc0 (diff) | |
Fix and test for cleaning a non-string value in a URLField
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16747 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
| -rw-r--r-- | tests/regressiontests/forms/tests/fields.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/tests/fields.py b/tests/regressiontests/forms/tests/fields.py index e1b7fe00c6..7cbe2eaccf 100644 --- a/tests/regressiontests/forms/tests/fields.py +++ b/tests/regressiontests/forms/tests/fields.py @@ -686,6 +686,10 @@ class FieldsTests(SimpleTestCase): url = u'http://t\xfcr.djangoproject.com/' self.assertEqual(url, f.clean(url)) + def test_urlfield_not_string(self): + f = URLField(required=False) + self.assertRaisesMessage(ValidationError, "[u'Enter a valid URL.']", f.clean, 23) + # BooleanField ################################################################ def test_booleanfield_1(self): |
