Changeset 15941 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 20 Jan 2020, 14:01:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
r15932 r15941 21 21 import os 22 22 import grok 23 from StringIO import StringIO 23 24 from datetime import datetime 24 25 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState … … 59 60 self.prepare_applicant() 60 61 storage = getUtility(IExtFileStore) 62 # The stored image can be fetched 61 63 file_id = IFileStoreNameChooser(self.applicant).chooseName() 62 # The stored image can be fetched63 64 fd = storage.getFile(file_id) 64 65 file_len_orig = len(fd.read()) 66 # We store a test pdf file 67 dummy_file = StringIO('test file') 68 testfile_id = IFileStoreNameChooser( 69 self.applicant).chooseName(attr='testfile.pdf') 70 test_file = storage.createFile(testfile_id, dummy_file) 71 # The stored file can be fetched 72 fd = storage.getFile(testfile_id) 73 testfile_len_orig = len(fd.read()) 65 74 self.assertEqual(self.app['students']._curr_stud_id, 1000000) 66 75 # Let's try to create the student … … 111 120 self.assertEqual(self.applicant.student_id, student.student_id) 112 121 # Check if passport image has been copied 113 storage = getUtility(IExtFileStore) 114 file_id = IFileStoreNameChooser( 115 student).chooseName(attr='passport.jpg') 122 file_id = IFileStoreNameChooser(student).chooseName(attr='passport.jpg') 116 123 fd = storage.getFile(file_id) 117 124 file_len = len(fd.read()) 118 125 self.assertEqual(file_len_orig, file_len) 126 # Check if test file has been copied too (new) 127 file_id = IFileStoreNameChooser(student).chooseName(attr='testfile.jpg') 128 fd = storage.getFile(file_id) 129 file_len = len(fd.read()) 130 self.assertEqual(testfile_len_orig, file_len) 119 131 # Check if application slip exists and is a PDF file 120 132 file_id = IFileStoreNameChooser(
Note: See TracChangeset for help on using the changeset viewer.