- Timestamp:
- 18 May 2012, 00:13:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r8452 r8467 130 130 131 131 def create_passport_img(self, student): 132 # create some fakedpassport file for `student`132 # create some passport file for `student` 133 133 storage = getUtility(IExtFileStore) 134 image_path = os.path.join(os.path.dirname(__file__), 'test_image.jpg') 135 self.image_contents = open(image_path, 'rb').read() 134 136 file_id = IFileStoreNameChooser(student).chooseName( 135 137 attr='passport.jpg') 136 storage.createFile(file_id, StringIO( 'I am a fake image.'))138 storage.createFile(file_id, StringIO(self.image_contents)) 137 139 138 140 def test_backup_single_student_data(self): … … 144 146 del_dir = self.app['datacenter'].deleted_path 145 147 del_img_path = os.path.join( 146 del_dir, 'media', 'students', '0011 1', 'A111111',148 del_dir, 'media', 'students', '00110', 'A111111', 147 149 'passport_A111111.jpg') 148 150 … … 151 153 self.assertEqual( 152 154 open(del_img_path, 'rb').read(), 153 'I am a fake image.')155 self.image_contents) 154 156 155 157 # The student data were put into CSV files
Note: See TracChangeset for help on using the changeset viewer.