1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

newforms-admin: Merged to [5439]

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-06-07 21:49:06 +00:00
parent 659d99b7af
commit d34639b09b
52 changed files with 3250 additions and 2809 deletions

View File

@@ -3656,6 +3656,25 @@ u' id="header"'
u' class="news" title="Read this"'
>>> flatatt({})
u''
####################################
# Test accessing errors in clean() #
####################################
>>> class UserForm(Form):
... username = CharField(max_length=10)
... password = CharField(widget=PasswordInput)
... def clean(self):
... data = self.cleaned_data
... if not self.errors:
... data['username'] = data['username'].lower()
... return data
>>> f = UserForm({'username': 'SirRobin', 'password': 'blue'})
>>> f.is_valid()
True
>>> f.cleaned_data['username']
u'sirrobin'
"""
__test__ = {