Django

Code

Changeset 4294

Show
Ignore:
Timestamp:
01/08/07 12:06:22 (2 years ago)
Author:
adrian
Message:

Fixed #3252 -- Fixed bugs in model_forms unit tests, related to recent newforms clean_data change. Thanks for the patch, mir@noris.de

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/model_forms/models.py

    r4263 r4294  
    6868 
    6969>>> f = CategoryForm({'name': 'Entertainment', 'url': 'entertainment'}) 
    70 >>> f.errors 
    71 {} 
     70>>> f.is_valid() 
     71True 
    7272>>> f.clean_data 
    7373{'url': u'entertainment', 'name': u'Entertainment'} 
     
    7979 
    8080>>> f = CategoryForm({'name': "It's a test", 'url': 'test'}) 
    81 >>> f.errors 
    82 {} 
     81>>> f.is_valid() 
     82True 
    8383>>> f.clean_data 
    8484{'url': u'test', 'name': u"It's a test"} 
     
    9292yet been saved. In this case, it's up to you to save it. 
    9393>>> f = CategoryForm({'name': 'Third test', 'url': 'third'}) 
    94 >>> f.errors 
    95 {} 
     94>>> f.is_valid() 
     95True 
    9696>>> f.clean_data 
    9797{'url': u'third', 'name': u'Third test'} 
     
    110110{'name': [u'This field is required.']} 
    111111>>> f.clean_data 
     112Traceback (most recent call last): 
     113... 
     114AttributeError: 'CategoryForm' object has no attribute 'clean_data' 
    112115>>> f.create() 
    113116Traceback (most recent call last):