- Timestamp:
- 22 Apr 2013, 11:21:11 (12 years ago)
- 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 329 329 """Create a browsable file-like object. 330 330 """ 331 ext = os.path.splitext(filename)[1].lower()332 if ext not in ['.jpg', '.png']:333 raise ValueError('Only .jpg and .png allowed')334 331 # call super method to ensure that any old files with 335 332 # different filename extension are deleted. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r10089 r10091 91 91 return 92 92 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 return93 #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 103 103 104 104 class ApplicantImageNameChooserTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.