Django

Code

Changeset 8842

Show
Ignore:
Timestamp:
09/01/08 22:07:26 (3 months ago)
Author:
mtredinnick
Message:

Fixed #8196 -- Make the model_form tests also pass if you don't have PIL
installed. We weren't relying on PIL previously, but the output was different
if it wasn't installed, which was triggering spurious failures. Patch from
Marty Alchin.

Files:

Legend:

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

    r8823 r8842  
    10311031>>> instance = f.save() 
    10321032>>> instance.image 
    1033 <ImageFieldFile: tests/test.png> 
     1033<...FieldFile: tests/test.png> 
    10341034 
    10351035# Delete the current file since this is not done by Django. 
     
    10431043>>> instance = f.save() 
    10441044>>> instance.image 
    1045 <ImageFieldFile: tests/test.png> 
     1045<...FieldFile: tests/test.png> 
    10461046 
    10471047# Edit an instance that already has the image defined in the model. This will not 
     
    10521052True 
    10531053>>> f.cleaned_data['image'] 
    1054 <ImageFieldFile: tests/test.png> 
     1054<...FieldFile: tests/test.png> 
    10551055>>> instance = f.save() 
    10561056>>> instance.image 
    1057 <ImageFieldFile: tests/test.png> 
     1057<...FieldFile: tests/test.png> 
    10581058 
    10591059# Delete the current image since this is not done by Django. 
     
    10681068>>> instance = f.save() 
    10691069>>> instance.image 
    1070 <ImageFieldFile: tests/test2.png> 
     1070<...FieldFile: tests/test2.png> 
    10711071 
    10721072# Delete the current file since this is not done by Django. 
     
    10791079>>> instance = f.save() 
    10801080>>> instance.image 
    1081 <ImageFieldFile: tests/test2.png> 
     1081<...FieldFile: tests/test2.png> 
    10821082 
    10831083# Delete the current file since this is not done by Django. 
     
    10931093>>> instance = f.save() 
    10941094>>> instance.image 
    1095 <ImageFieldFile: None> 
     1095<...FieldFile: None> 
    10961096 
    10971097>>> f = ImageFileForm(data={'description': u'And a final one'}, files={'image': SimpleUploadedFile('test3.png', image_data)}, instance=instance) 
     
    11001100>>> instance = f.save() 
    11011101>>> instance.image 
    1102 <ImageFieldFile: tests/test3.png> 
     1102<...FieldFile: tests/test3.png> 
    11031103 
    11041104# Delete the current file since this is not done by Django. 
     
    11111111>>> instance = f.save() 
    11121112>>> instance.image 
    1113 <ImageFieldFile: tests/test3.png> 
     1113<...FieldFile: tests/test3.png> 
    11141114>>> instance.delete() 
    11151115