Ticket #6825: model-windows-fix.diff

File model-windows-fix.diff, 1.9 KB (added by jerickso, 7 years ago)

Patch to moteltests/models_forms/models.py that removes the / when testing the filenames.

  • tests/modeltests/model_forms/models.py

     
    766766<class 'django.newforms.fields.UploadedFile'>
    767767>>> instance = f.save()
    768768>>> instance.file
    769 u'.../test1.txt'
     769u'...test1.txt'
    770770
    771771# Edit an instance that already has the file defined in the model. This will not
    772772# save the file again, but leave it exactly as it is.
     
    775775>>> f.is_valid()
    776776True
    777777>>> f.cleaned_data['file']
    778 u'.../test1.txt'
     778u'...test1.txt'
    779779>>> instance = f.save()
    780780>>> instance.file
    781 u'.../test1.txt'
     781u'...test1.txt'
    782782
    783783# Delete the current file since this is not done by Django.
    784784
     
    791791True
    792792>>> instance = f.save()
    793793>>> instance.file
    794 u'.../test2.txt'
     794u'...test2.txt'
    795795
    796796>>> instance.delete()
    797797
     
    810810True
    811811>>> instance = f.save()
    812812>>> instance.file
    813 u'.../test3.txt'
     813u'...test3.txt'
    814814>>> instance.delete()
    815815
    816816# ImageField ###################################################################
     
    832832<class 'django.newforms.fields.UploadedFile'>
    833833>>> instance = f.save()
    834834>>> instance.image
    835 u'.../test.png'
     835u'...test.png'
    836836
    837837# Edit an instance that already has the image defined in the model. This will not
    838838# save the image again, but leave it exactly as it is.
     
    841841>>> f.is_valid()
    842842True
    843843>>> f.cleaned_data['image']
    844 u'.../test.png'
     844u'...test.png'
    845845>>> instance = f.save()
    846846>>> instance.image
    847 u'.../test.png'
     847u'...test.png'
    848848
    849849# Delete the current image since this is not done by Django.
    850850
     
    857857True
    858858>>> instance = f.save()
    859859>>> instance.image
    860 u'.../test2.png'
     860u'...test2.png'
    861861
    862862>>> instance.delete()
    863863
     
    876876True
    877877>>> instance = f.save()
    878878>>> instance.image
    879 u'.../test3.png'
     879u'...test3.png'
    880880>>> instance.delete()
    881881
    882882"""}
Back to Top