Ignore:
Timestamp:
6 Sep 2012, 07:43:51 (12 years ago)
Author:
Henrik Bettermann
Message:

In contrast to the comment of the last revision: We need to store validation_date and validated_by also in Kofa. They have to be set by the workflow transition events. They must not be editable (but importable and exportable).

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

Legend:

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

    r9148 r9161  
    967967        self.app['users'].addUser('mrsadvise', 'mrsadvisesecret')
    968968        self.app['users']['mrsadvise'].email = 'mradvise@foo.ng'
    969         self.app['users']['mrsadvise'].title = 'Helen Procter'
     969        self.app['users']['mrsadvise'].title = u'Helen Procter'
    970970        # Assign local CourseAdviser100 role for a certificate
    971971        cert = self.app['faculties']['fac1']['dep1'].certificates['CERT1']
     
    10181018        # the 100L CA does see the 'Validate' button
    10191019        self.browser.open(L110_student_path)
    1020         self.assertFalse('Validate' in self.browser.contents)
     1020        self.assertFalse('Validate courses' in self.browser.contents)
    10211021        IWorkflowInfo(self.student).fireTransition('register_courses')
    10221022        self.browser.open(L110_student_path)
    1023         self.assertFalse('Validate' in self.browser.contents)
     1023        self.assertFalse('Validate courses' in self.browser.contents)
    10241024        self.student['studycourse'].current_level = 110
    10251025        self.browser.open(L110_student_path)
    1026         self.assertTrue('Validate' in self.browser.contents)
     1026        self.assertTrue('Validate courses' in self.browser.contents)
    10271027        # ... but a 100L CA does not see the button on other levels
    10281028        studylevel2 = StudentStudyLevel()
     
    10321032        L200_student_path = self.studycourse_path + '/200'
    10331033        self.browser.open(L200_student_path)
    1034         self.assertFalse('Validate' in self.browser.contents)
     1034        self.assertFalse('Validate courses' in self.browser.contents)
    10351035        self.browser.open(L110_student_path)
    10361036        self.browser.getLink("Validate courses").click()
    10371037        self.assertTrue('Course list has been validated' in self.browser.contents)
    10381038        self.assertTrue('courses validated' in self.browser.contents)
     1039        self.assertEqual(self.student['studycourse']['110'].validated_by,
     1040            'Helen Procter')
     1041        self.assertMatches(
     1042            '<YYYY-MM-DD hh:mm:ss>',
     1043            self.student['studycourse']['110'].validation_date.strftime(
     1044                "%Y-%m-%d %H:%M:%S"))
    10391045        self.browser.getLink("Reject courses").click()
    10401046        self.assertTrue('Course list request has been annulled.'
     
    10441050            '/contactstudent?subject=%s' % urlmessage)
    10451051        self.assertTrue('school fee paid' in self.browser.contents)
     1052        self.assertTrue(self.student['studycourse']['110'].validated_by is None)
     1053        self.assertTrue(self.student['studycourse']['110'].validation_date is None)
    10461054        IWorkflowInfo(self.student).fireTransition('register_courses')
    10471055        self.browser.open(L110_student_path)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9148 r9161  
    209209        self.assertEqual(
    210210            result,
    211             'level,level_session,level_verdict,student_id\r\n'
    212             ',,0,\r\n'
     211            'level,level_session,level_verdict,validated_by,validation_date,'
     212            'student_id\r\n'
     213            ',,0,,,\r\n'
    213214            )
    214215        return
     
    225226        self.assertEqual(
    226227            result,
    227             'level,level_session,level_verdict,student_id\r\n'
    228             '100,2012,A,A111111\r\n'
     228            'level,level_session,level_verdict,validated_by,validation_date,'
     229            'student_id\r\n'
     230            '100,2012,A,,,A111111\r\n'
    229231            )
    230232        return
     
    239241        self.assertEqual(
    240242            result,
    241             'level,level_session,level_verdict,student_id\r\n'
    242             '100,2012,A,A111111\r\n'
     243            'level,level_session,level_verdict,validated_by,validation_date,'
     244            'student_id\r\n'
     245            '100,2012,A,,,A111111\r\n'
    243246            )
    244247        return
     
    252255        self.assertEqual(
    253256            result,
    254             'level,level_session,level_verdict,student_id\r\n'
    255             '100,2012,A,A111111\r\n'
     257            'level,level_session,level_verdict,validated_by,validation_date,'
     258            'student_id\r\n'
     259            '100,2012,A,,,A111111\r\n'
    256260            )
    257261        return
Note: See TracChangeset for help on using the changeset viewer.