Changeset 15416 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 21 May 2019, 08:02:51 (6 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r15203 r15416 652 652 `ticket_session` is an additional attribute which can be used to store the 653 653 session of the course when it was taken. Usually this information is 654 redundant because the the parent study level object already contains this654 redundant because the the parent study level object already contains this 655 655 information except for the study level zero container which can be used to 656 656 store 'orphaned' course tickets. -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r15163 r15416 486 486 del_dir = site['datacenter'].deleted_path 487 487 488 if student.state == GRADUATED: 489 del_dir = site['datacenter'].graduated_path 490 488 491 # save files of the student 489 492 move_student_files(student, del_dir) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r13314 r15416 30 30 from zope.interface import verify 31 31 from zope.schema.interfaces import RequiredMissing 32 from hurry.workflow.interfaces import IWorkflowState 32 33 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser 33 34 from waeup.kofa.students.student import ( … … 180 181 del_dir, 'media', 'students', '00110', 'A111111', 181 182 'passport_A111111.jpg') 182 183 183 # The image was copied over 184 184 self.assertTrue(os.path.isfile(del_img_path)) … … 186 186 open(del_img_path, 'rb').read(), 187 187 self.image_contents) 188 189 188 # The student data were put into CSV files 190 189 STUDENT_BACKUP_EXPORTER_NAMES = getUtility( 191 190 IStudentsUtils).STUDENT_BACKUP_EXPORTER_NAMES 192 191 for name in STUDENT_BACKUP_EXPORTER_NAMES: 192 csv_path = os.path.join(del_dir, '%s.csv' % name) 193 self.assertTrue(os.path.isfile(csv_path)) 194 contents = open(csv_path, 'rb').read().split('\r\n') 195 # We expect 3 lines output including a linebreak at end of file. 196 self.assertEqual(len(contents), 3) 197 return 198 199 def test_backup_single_graduated_data(self): 200 # when a single graduated student is removed, the data is backed up 201 # somewhere else 202 self.setup_student(self.student) 203 IWorkflowState(self.student).setState('graduated') 204 # Add a fake image 205 self.create_passport_img(self.student) 206 handle_student_removed(self.student, None) 207 del_dir = self.app['datacenter'].graduated_path 208 del_img_path = os.path.join( 209 del_dir, 'media', 'students', '00110', 'A111111', 210 'passport_A111111.jpg') 211 # The image was copied over 212 self.assertTrue(os.path.isfile(del_img_path)) 213 self.assertEqual( 214 open(del_img_path, 'rb').read(), 215 self.image_contents) 216 # The student data were put into CSV files 217 STUDENT_BACKUP_EXPORTER_NAMES = getUtility( 218 IStudentsUtils).STUDENT_BACKUP_EXPORTER_NAMES 193 219 for name in STUDENT_BACKUP_EXPORTER_NAMES: 194 220 csv_path = os.path.join(del_dir, '%s.csv' % name)
Note: See TracChangeset for help on using the changeset viewer.