Changeset 11483
- Timestamp:
- 12 Mar 2014, 18:38:35 (11 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r11482 r11483 4 4 1.0.1dev (unreleased) 5 5 ===================== 6 7 * Do also export student and course ticket data of students on probation. 6 8 7 9 * 'Create student' option removed from 'Application Transition' -
main/waeup.kofa/trunk/src/waeup/kofa/catalog.py
r9847 r11483 124 124 if idx_name == 'catalog': 125 125 continue 126 if value is not None and ('session' in idx_name 127 or 'level' in idx_name): 128 value = int(value) 126 if value is not None: 127 if 'session' in idx_name or 'level' in idx_name: 128 value = int(value) 129 if idx_name in ('level', 'current_level'): 130 value = int(value) 131 if value not in (10, 999): 132 value = (value, value + 90) 129 133 if not isinstance(value, tuple): 130 134 value = (value, value) -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r10650 r11483 79 79 if ticket.code != code: 80 80 continue 81 if level is not None and int(level) != level_obj.level: 82 continue 81 if level is not None: 82 level = int(level) 83 if level_obj.level in (10, 999, None) \ 84 and int(level) != level_obj.level: 85 continue 86 if level_obj.level not in range(level, level+100, 10): 87 continue 83 88 if level_session is not None and \ 84 89 int(level_session) != level_obj.level_session: -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r10874 r11483 207 207 current_session=2012, current_level=None) 208 208 result2 = open(self.outfile, 'rb').read() 209 # current_level can be both a string ...209 # current_level and current_session can be both a string ... 210 210 exporter.export_filtered( 211 211 self.app, self.outfile, 212 current_session= None, current_level=u'200')212 current_session='2012', current_level=u'200') 213 213 result3 = open(self.outfile, 'rb').read() 214 214 exporter.export_filtered( … … 221 221 current_session=None, current_level=100) 222 222 result5 = open(self.outfile, 'rb').read() 223 # Also students at probating levels are being exported ... 224 self.student['studycourse'].current_level = 210 225 notify(grok.ObjectModifiedEvent(self.student)) 226 exporter.export_filtered( 227 self.app, self.outfile, 228 current_session=None, current_level=200) 229 result6 = open(self.outfile, 'rb').read() 230 # ... but not in the wrong level range. 231 self.student['studycourse'].current_level = 310 232 notify(grok.ObjectModifiedEvent(self.student)) 233 exporter.export_filtered( 234 self.app, self.outfile, 235 current_session=None, current_level=200) 236 result7 = open(self.outfile, 'rb').read() 223 237 self.assertTrue(self.std_csv_entry in result1) 224 238 self.assertTrue(self.std_csv_entry in result2) 225 239 self.assertTrue(self.std_csv_entry in result3) 226 self.assertTrue(self.std_csv_entry not in result4) 227 self.assertTrue(self.std_csv_entry not in result5) 240 self.assertFalse(self.std_csv_entry in result4) 241 self.assertFalse(self.std_csv_entry in result5) 242 self.assertTrue(self.std_csv_entry in result6) 243 self.assertFalse(self.std_csv_entry in result7) 228 244 return 229 245 … … 467 483 exporter = StudentStudyLevelExporter() 468 484 exporter.export_filtered( 469 self.student, self.outfile , current_level=200)485 self.student, self.outfile) 470 486 result = open(self.outfile, 'rb').read() 471 487 self.assertEqual( … … 569 585 exporter = CourseTicketExporter() 570 586 exporter.export_filtered( 571 self.student, self.outfile , current_level=200)587 self.student, self.outfile) 572 588 result = open(self.outfile, 'rb').read() 573 589 self.assertEqual( … … 596 612 'automatic,carry_over,code,credits,dcode,fcode,level,level_session,' 597 613 'mandatory,passmark,score,semester,title,student_id,certcode\r\n' 614 ) 615 # Also tickets in probating levels are exported. Therefore 616 # we change the level attribute to fake a 110 level. 617 self.student['studycourse']['100'].level = 110 618 notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1'])) 619 exporter.export_filtered( 620 self.student, self.outfile, catalog='coursetickets', code='CRS1', level='100') 621 result = open(self.outfile, 'rb').read() 622 self.assertEqual( 623 result, 624 'automatic,carry_over,code,credits,dcode,fcode,level,level_session,' 625 'mandatory,passmark,score,semester,title,student_id,certcode\r\n' 626 '1,1,CRS1,100,DEP1,FAC1,110,2012,0,100,,2,Course 1,A111111,CERT1\r\n' 598 627 ) 599 628 return
Note: See TracChangeset for help on using the changeset viewer.