Ignore:
Timestamp:
29 Sep 2016, 08:54:32 (8 years ago)
Author:
Henrik Bettermann
Message:

Add imported_gpa and imported_cgpa fields and adjust exporters and batch processors.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students/tests
Files:
2 edited

Legend:

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

    r14165 r14206  
    4343
    4444
    45 class StudentProcessorTest(FunctionalTestCase):
    46     """Perform some batching tests.
    47     """
    48 
    49     layer = FunctionalLayer
    50 
    51     def setUp(self):
    52         super(StudentProcessorTest, self).setUp()
    53         # Setup a sample site for each test
    54         app = University()
    55         self.dc_root = tempfile.mkdtemp()
    56         app['datacenter'].setStoragePath(self.dc_root)
    57 
    58         # Prepopulate the ZODB...
    59         self.getRootFolder()['app'] = app
    60         # we add the site immediately after creation to the
    61         # ZODB. Catalogs and other local utilities are not setup
    62         # before that step.
    63         self.app = self.getRootFolder()['app']
    64         # Set site here. Some of the following setup code might need
    65         # to access grok.getSite() and should get our new app then
    66         setSite(app)
    67 
    68 
    69     def tearDown(self):
    70         super(StudentProcessorTest, self).tearDown()
    71         shutil.rmtree(self.workdir)
    72         shutil.rmtree(self.dc_root)
    73         clearSite()
    74         return
    75 
    7645UPLOAD_CSV_TEMPLATE = (
    7746    'matric_number,student_id,display_fullname,level,code,level_session,'
     
    144113        self.assertEqual(self.student['studycourse']['100'].gpa_params[2], 82.0)
    145114        # sgpa = 82 / 23
    146         self.assertEqual(self.student['studycourse']['100'].gpa_params[0], 3.565)
     115        self.assertEqual(
     116            self.student['studycourse']['100'].gpa_params[0], 3.565)
     117        # imported gpa values override calculated values
     118        studylevel.imported_gpa = 4.3
     119        studylevel.imported_cgpa = 5.4
     120        self.assertEqual(self.student['studycourse']['100'].gpa_params[0], 4.3)
     121        self.assertEqual(
     122            self.student['studycourse']['100'].cumulative_params[0], 5.4)
     123        self.assertEqual(self.student['studycourse']['100'].gpa, 4.3)
     124        self.student['studycourse'].imported_cgpa = 6.6
     125        self.assertEqual(
     126            self.student['studycourse'].getTranscriptData()[1], 6.6)
    147127        return
    148128
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_export.py

    r14111 r14206  
    138138        self.assertEqual(
    139139            result,
    140             'gpa,level,level_session,level_verdict,total_credits,'
     140            'gpa,imported_cgpa,imported_gpa,'
     141            'level,level_session,level_verdict,total_credits,'
    141142            'total_credits_s1,total_credits_s2,'
    142143            'validated_by,validation_date,'
    143144            'student_id,number_of_tickets,certcode\r\n'
    144             '0.0,100,2012,A,100,,,,,A111111,1,CERT1\r\n'
     145            '0.0,,,100,2012,A,100,,,,,A111111,1,CERT1\r\n'
    145146            )
    146147        return
Note: See TracChangeset for help on using the changeset viewer.