Changeset 9136 for main/waeup.kofa/trunk


Ignore:
Timestamp:
31 Aug 2012, 15:23:50 (12 years ago)
Author:
Henrik Bettermann
Message:

Copy entry_session when transferring students. The entry session always remains the same.

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

Legend:

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

    r9132 r9136  
    144144
    145145    def transfer(self, certificate, current_session=None,
    146         current_level=None, current_verdict=None, previous_verdict=None,
    147         entry_session=None):
     146        current_level=None, current_verdict=None, previous_verdict=None):
    148147        """ Creates a new studycourse and backups the old one.
    149148
     
    156155        studycourse.current_verdict = current_verdict
    157156        studycourse.previous_verdict = previous_verdict
    158         studycourse.entry_session = entry_session
    159157        old = self['studycourse']
     158        studycourse.entry_session = old.entry_session
    160159        # Students can be transferred only two times.
    161160        if 'studycourse_1' in self.keys():
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py

    r9132 r9136  
    268268            RequiredMissing, self.student.transfer, self.certificate2)
    269269        success = self.student.transfer(self.certificate2,
    270             current_session=2013, entry_session=2010)
     270            current_session=2013)
    271271        self.assertEqual(self.student['studycourse_1'].certificate.code, 'CERT1')
    272272        self.assertEqual(self.student['studycourse'].certificate.code, 'CERT2')
    273273        self.assertEqual(self.student['studycourse_1'].current_session, 2012)
    274274        self.assertEqual(self.student['studycourse'].current_session, 2013)
     275        self.assertEqual(self.student['studycourse'].entry_session,
     276            self.student['studycourse_1'].entry_session)
    275277        self.assertEqual(self.student['studycourse_1'].__name__, 'studycourse_1')
    276278        logfile = os.path.join(
     
    296298        # Students can be transferred (only) two times.
    297299        success = self.student.transfer(self.certificate,
    298             current_session=2013, entry_session=2010)
     300            current_session=2013)
    299301        self.assertTrue(success)
    300302        success = self.student.transfer(self.certificate2,
    301             current_session=2013, entry_session=2010)
     303            current_session=2013)
    302304        self.assertFalse(success)
    303305        self.assertEqual([i for i in self.student.keys()],
Note: See TracChangeset for help on using the changeset viewer.