Ignore:
Timestamp:
16 Aug 2019, 12:40:20 (5 years ago)
Author:
Henrik Bettermann
Message:

Add semester filter to Fix CourseTicketExporter.

File:
1 edited

Legend:

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

    r15333 r15546  
    690690            'Anna M. Tester\r\n'
    691691            )
    692         # We can set the course tickets level and level_session without code
    693         # (used in the datacenter)
     692        # We can set the course tickets level, semester and level_session
     693        # without code (used in the datacenter)
    694694        notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
    695695        exporter.export_filtered(self.student, self.outfile, ct_level='100',
    696             ct_session='2012')
     696            ct_session='2012', ct_semester='2')
    697697        result = open(self.outfile, 'rb').read()
    698698        self.assertEqual(
     
    707707        notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
    708708        exporter.export_filtered(self.student, self.outfile, ct_level='all',
    709             ct_session='2012')
     709            ct_session='2012', ct_semester='all')
    710710        result = open(self.outfile, 'rb').read()
    711711        self.assertEqual(
     
    731731        exporter.export_filtered(self.student, self.outfile,
    732732            ct_level='all', ct_session='2013')
     733        result = open(self.outfile, 'rb').read()
     734        self.assertEqual(
     735            result,
     736            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
     737            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
     738            'display_fullname\r\n'
     739            )
     740        # 1st semester tickets do not exist.
     741        notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
     742        exporter.export_filtered(self.student, self.outfile,
     743            ct_level='all', ct_session='all', ct_semester='1')
    733744        result = open(self.outfile, 'rb').read()
    734745        self.assertEqual(
Note: See TracChangeset for help on using the changeset viewer.