summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-08-23 04:59:25 +0000
committerBrian Rosner <brosner@gmail.com>2008-08-23 04:59:25 +0000
commit5061970b76194d6a170d80ffab18260f138951c4 (patch)
tree631b931d5a3c7548c691a8b4d1f0b53ef7ff9cdc /tests
parenta64dc39fb7c6787c83ea2e807c5bf2f94ad5909d (diff)
Fixed #8040 -- SlugField now returns a proper formfield to deal with validation. Thanks Daniel Pope for the ticket and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/model_forms/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index c7e726ee4e..da45f23f74 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -301,11 +301,11 @@ u'third-test'
[<Category: Entertainment>, <Category: It's a test>, <Category: Third test>]
If you call save() with invalid data, you'll get a ValueError.
->>> f = CategoryForm({'name': '', 'slug': '', 'url': 'foo'})
+>>> f = CategoryForm({'name': '', 'slug': 'not a slug!', 'url': 'foo'})
>>> f.errors['name']
[u'This field is required.']
>>> f.errors['slug']
-[u'This field is required.']
+[u"Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."]
>>> f.cleaned_data
Traceback (most recent call last):
...