Ignore:
Timestamp:
11 Mar 2013, 11:47:20 (12 years ago)
Author:
Henrik Bettermann
Message:

Add more tests to see if the export file of the course ticket exporter really contains the data expected.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

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

    r10001 r10016  
    29292929            return
    29302930        if session == 'all':
    2931             session=None
     2931            session = None
    29322932        if level == 'all':
    29332933            level = None
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r10014 r10016  
    905905        self.assertEqual(courseticket.passmark, 40)
    906906        self.assertEqual(courseticket.semester, 1)
     907        self.assertEqual(courseticket.level, 100)
     908        self.assertEqual(courseticket.level_session, 2008)
    907909        shutil.rmtree(os.path.dirname(fin_file))
    908910        logcontent = open(self.logfile).read()
     
    914916            'mandatory=False, score=3'
    915917            in logcontent)
     918
     919        # The catalog has been updated
     920        cat = queryUtility(ICatalog, name='coursetickets_catalog')
     921        results = list(
     922            cat.searchResults(
     923            level=(100, 100)))
     924        self.assertEqual(len(results),3)
    916925
    917926    def test_import_update(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9938 r10016  
    29762976
    29772977    def test_course_export_coursetickets(self):
     2978        # We add study level 100 to the student's studycourse
     2979        studylevel = StudentStudyLevel()
     2980        studylevel.level = 100
     2981        studylevel.level_session = 2004
     2982        self.student['studycourse'].addStudentStudyLevel(
     2983            self.certificate,studylevel)
    29782984        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    29792985        course1_path = 'http://localhost/app/faculties/fac1/dep1/courses/COURSE1'
     
    29852991        self.browser.getControl(name="level").value = ['100']
    29862992        self.browser.getControl("Create CSV file").click()
    2987 
    29882993        # When the job is finished and we reload the page...
    29892994        job_id = self.wait_for_export_job_completed()
     
    29963001            'filename="WAeUP.Kofa_coursetickets_%s.csv' % job_id in
    29973002            self.browser.headers['content-disposition'])
     3003        # ... and contains the course ticket COURSE1
     3004        self.assertEqual(self.browser.contents,
     3005            'automatic,carry_over,code,credits,dcode,fcode,level,'
     3006            'level_session,mandatory,passmark,score,semester,title,'
     3007            'student_id,certcode\r\n1,0,COURSE1,10,dep1,fac1,100,2004,1,40,,1,'
     3008            'Unnamed Course,K1000000,CERT1\r\n')
     3009
    29983010        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
    29993011        job_id = self.app['datacenter'].running_exports[0][0]
    3000         # ... and discarded
     3012        # Thew job can be discarded
    30013013        self.browser.open(course1_path + '/exports')
    30023014        self.browser.getControl("Discard").click()
Note: See TracChangeset for help on using the changeset viewer.