Ignore:
Timestamp:
2 Sep 2013, 11:56:21 (11 years ago)
Author:
Henrik Bettermann
Message:

Add test_create_pdf_with_two_levels_in_session.

File:
1 edited

Legend:

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

    r10579 r10580  
    6262        open(path, 'wb').write(result)
    6363        print "Sample session_results_presentation.pdf written to %s" % path
     64        return
     65
     66    def test_create_pdf_with_two_levels_in_session(self):
     67        # Register second level in the same session (which shouldn't be!)
     68        # Check the pdf file if the student record has really been classified
     69        # as erroneous.
     70        studylevel = StudentStudyLevel()
     71        studylevel.level = 200
     72        studylevel.level_session = 2010
     73        self.student['studycourse']['200'] = studylevel
     74        report = SessionResultsPresentation('fac1', 'dep1', 2010, None)
     75        result = report.create_pdf()
     76        self.assertTrue(result.startswith('%PDF-'))
     77        path = os.path.join(samples_dir(), 'session_results_presentation_erroneous.pdf')
     78        open(path, 'wb').write(result)
     79        print "Sample session_results_presentation_erroneous.pdf written to %s" % path
    6480        return
    6581
Note: See TracChangeset for help on using the changeset viewer.