Ignore:
Timestamp:
4 Mar 2022, 21:27:24 (3 years ago)
Author:
Henrik Bettermann
Message:

Implement OutstandingCourses2Exporter (ticket 699)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_export.py

    r16617 r16859  
    1212    CustomCourseTicketExporter,
    1313    LevelReportDataExporter,
    14     CustomStudentStudyCourseExporter)
     14    CustomStudentStudyCourseExporter,
     15    OutstandingCourses2Exporter)
    1516from waeup.aaue.testing import FunctionalLayer
    1617
     
    226227        return
    227228
    228 
     229class OutstandingCourses2ExporterTest(StudentImportExportSetup):
     230
     231    layer = FunctionalLayer
     232
     233    def setUp(self):
     234        super(OutstandingCourses2ExporterTest, self).setUp()
     235        self.setup_for_export()
     236        return
     237
     238    def test_export_all(self):
     239        # we can really export all course tickets
     240        # set values we can expect in export file
     241        self.setup_student(self.student)
     242        self.student['studycourse']['100']['CRS1'].course_category = 'C'
     243        exporter = OutstandingCourses2Exporter()
     244        exporter.export_all(self.app, self.outfile)
     245        result = open(self.outfile, 'rb').read()
     246        self.assertEqual(
     247            result,
     248            'student_id,matric_number,certcode,display_fullname,code,'
     249            'course_category,remark\r\n'
     250            'A111111,234,CERT1,"TESTER, Anna M.",CRS1,C,nottaken\r\n'
     251            )
     252        return
     253
     254
Note: See TracChangeset for help on using the changeset viewer.