Changeset 11483 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 12 Mar 2014, 18:38:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.