Ignore:
Timestamp:
13 Jan 2020, 23:51:00 (5 years ago)
Author:
Henrik Bettermann
Message:

Add TranscriptDataExporter and reorganize exporter names.

File:
1 edited

Legend:

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

    r15918 r15920  
    3636    StudentUnpaidPaymentExporter, SessionPaymentsOverviewExporter,
    3737    StudentOutstandingCoursesExporter,
    38     AccommodationPaymentsExporter, get_students,)
     38    AccommodationPaymentsExporter,
     39    StudentTranscriptDataExporter,
     40    get_students,)
    3941from waeup.kofa.students.accommodation import BedTicket
    4042from waeup.kofa.students.interfaces import ICSVStudentExporter
     
    813815    def test_get_as_utility(self):
    814816        # we can get an student exporter as utility
    815         result = queryUtility(ICSVExporter, name="studentoutstandingcourses")
     817        result = queryUtility(ICSVExporter, name="outstandingcourses")
    816818        self.assertTrue(result is not None)
    817819        return
     
    15301532            )
    15311533        return
     1534
     1535class StudentTranscriptDataExporterTest(StudentImportExportSetup):
     1536
     1537    layer = FunctionalLayer
     1538
     1539    def setUp(self):
     1540        super(StudentTranscriptDataExporterTest, self).setUp()
     1541        self.setup_for_export()
     1542        return
     1543
     1544    def test_export_all(self):
     1545        self.setup_student(self.student)
     1546        exporter = StudentTranscriptDataExporter()
     1547        exporter.export_all(self.app, self.outfile)
     1548        result = open(self.outfile, 'rb').read()
     1549        self.assertTrue(
     1550            'student_id,state,certcode,faccode,depcode,entry_session,'
     1551            'current_level,current_session,transcript_data\r\n'
     1552            'A111111,created,CERT1,NA,NA,2010,200,2012,'
     1553            'Level 100; 1st: ; 2nd: CRS1; 3rd: ; sgpa: 0.0\r\n'
     1554            in result
     1555            )
     1556        return
Note: See TracChangeset for help on using the changeset viewer.