Changeset 10634 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 21 Sep 2013, 08:27:47 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10632 r10634 3071 3071 self.current_academic_session = grok.getSite()[ 3072 3072 'configuration'].current_academic_session 3073 if self.context.__parent__.__parent__.score_editing_disabled: 3074 self.flash(_('Score editing disabled.')) 3075 self.redirect(self.url(self.context)) 3076 return 3073 3077 if not self.current_academic_session: 3074 3078 self.flash(_('Current academic session not set.')) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r10574 r10634 49 49 def test_get_student_stats_session_multiple(self): 50 50 # we can get a table with several students 51 self.create_cert( 'fac2', 'dept2','CERT2')51 self.create_cert(u'fac2', u'dept2', u'CERT2') 52 52 result1 = get_student_stats(2010, 'Undergraduate Full-Time') 53 53 result2 = get_student_stats(2009, 'Undergraduate Full-Time') … … 69 69 70 70 def test_create_pdf(self): 71 self.create_cert( 'FAC2', 'dept2','CERT2')71 self.create_cert(u'FAC2', u'dept2', u'CERT2') 72 72 report = StudentStatisticsReport(2010, 'Undergraduate Full-Time') 73 73 result = report.create_pdf() -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10598 r10634 1683 1683 self.student['studycourse']['100']['COURSE1'].course, 1684 1684 self.course) 1685 # Lecturer can neither access th sstudent ...1685 # Lecturer can neither access the student ... 1686 1686 self.assertRaises( 1687 1687 Unauthorized, self.browser.open, self.student_path) 1688 # ... nor the respective course ticket since a1688 # ... nor the respective course ticket since 1689 1689 # editing course tickets by lecturers is not feasible. 1690 # Course results must be imported.1691 1690 self.assertTrue('COURSE1' in self.student['studycourse']['100'].keys()) 1692 1691 course_ticket_path = self.student_path + '/studycourse/100/COURSE1' 1693 1692 self.assertRaises( 1694 1693 Unauthorized, self.browser.open, course_ticket_path) 1694 # Course results can be batch edited via the edit_courses view 1695 self.app['faculties']['fac1']['dep1'].score_editing_disabled = True 1696 self.browser.open("http://localhost/app/faculties/fac1/dep1/courses/COURSE1") 1697 self.browser.getLink("Update scores").click() 1698 self.assertTrue('Score editing disabled' in self.browser.contents) 1699 self.app['faculties']['fac1']['dep1'].score_editing_disabled = False 1700 self.browser.getLink("Update scores").click() 1701 self.assertTrue('Current academic session not set' in self.browser.contents) 1702 self.app['configuration'].current_academic_session = 2004 1703 self.browser.getLink("Update scores").click() 1704 self.assertFalse( 1705 '<input type="text" name="scores" class="span1" />' 1706 in self.browser.contents) 1707 IWorkflowState(self.student).setState('courses validated') 1708 # Student must be in state 'courses validated' 1709 self.browser.open( 1710 "http://localhost/app/faculties/fac1/dep1/courses/COURSE1/edit_scores") 1711 self.assertTrue( 1712 '<input type="text" name="scores" class="span1" />' 1713 in self.browser.contents) 1714 self.browser.getControl(name="scores", index=0).value = '55' 1715 self.browser.getControl("Update scores").click() 1716 # New score has been set 1717 self.assertEqual( 1718 self.student['studycourse']['100']['COURSE1'].score, 55) 1719 # Score editing has been logged 1720 logfile = os.path.join( 1721 self.app['datacenter'].storage, 'logs', 'students.log') 1722 logcontent = open(logfile).read() 1723 self.assertTrue('mrslecturer - students.browser.EditScoresPage - ' 1724 'K1000000 100/COURSE1 score updated (55)' in logcontent) 1695 1725 1696 1726 def test_change_current_mode(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_move.py
r9341 r10634 31 31 self.app['faculties']['fac1']['dep1'].certificates['CERT1'], 32 32 self.certificate) 33 self.app['faculties']['fac1']['dep2'] = Department(code= 'dep2')33 self.app['faculties']['fac1']['dep2'] = Department(code=u'dep2') 34 34 self.certificate.moveCertificate('fac1', 'dep2') 35 35 self.assertEqual(
Note: See TracChangeset for help on using the changeset viewer.