Django

Code

Changeset 5354

Show
Ignore:
Timestamp:
05/26/07 04:47:47 (2 years ago)
Author:
mtredinnick
Message:

Added a new form test that I forgot to commit in [5348]. Refs #3718.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/forms/tests.py

    r5302 r5354  
    36563656>>> flatatt({}) 
    36573657u'' 
     3658 
     3659#################################### 
     3660# Test accessing errors in clean() # 
     3661#################################### 
     3662 
     3663>>> class UserForm(Form): 
     3664...     username = CharField(max_length=10) 
     3665...     password = CharField(widget=PasswordInput) 
     3666...     def clean(self): 
     3667...         data = self.cleaned_data 
     3668...         if not self.errors: 
     3669...             data['username'] = data['username'].lower() 
     3670...         return data 
     3671 
     3672>>> f = UserForm({'username': 'SirRobin', 'password': 'blue'}) 
     3673>>> f.is_valid() 
     3674True 
     3675>>> f.cleaned_data['username'] 
     3676u'sirrobin' 
    36583677""" 
    36593678