Changeset 10091 for main


Ignore:
Timestamp:
22 Apr 2013, 11:21:11 (12 years ago)
Author:
Henrik Bettermann
Message:

The image store handler is now a file store handler. File extensions are checked elsewhere.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py

    r10089 r10091  
    329329        """Create a browsable file-like object.
    330330        """
    331         ext = os.path.splitext(filename)[1].lower()
    332         if ext not in ['.jpg', '.png']:
    333             raise ValueError('Only .jpg and .png allowed')
    334331        # call super method to ensure that any old files with
    335332        # different filename extension are deleted.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py

    r10089 r10091  
    9191        return
    9292
    93     def test_image_store_handler_invalid_filename_ext(self):
    94         # we only accept '.jpg' and '.png' as filename extensions.
    95         store = DefaultStorage(self.workdir)
    96         handler = queryUtility(IFileStoreHandler, name='img-applicant')
    97         self.assertRaises(
    98             ValueError,
    99             handler.createFile,
    100             store, store.root, 'sample.txt', '__img_applicant__sample',
    101             StringIO('I am a txt file'))
    102         return
     93    #def test_image_store_handler_invalid_filename_ext(self):
     94    #    # we only accept '.jpg' and '.png' as filename extensions.
     95    #    store = DefaultStorage(self.workdir)
     96    #    handler = queryUtility(IFileStoreHandler, name='img-applicant')
     97    #    self.assertRaises(
     98    #        ValueError,
     99    #        handler.createFile,
     100    #        store, store.root, 'sample.txt', '__img_applicant__sample',
     101    #        StringIO('I am a txt file'))
     102    #    return
    103103
    104104class ApplicantImageNameChooserTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.