Changeset 10634 for main/waeup.kofa/trunk/src
- Timestamp:
- 21 Sep 2013, 08:27:47 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r10435 r10634 116 116 # The code has explicitely to be set, otherwise we don't 117 117 # find created students in their department 118 self.app['faculties']['fac1']['dep1'] = Department(code= 'dep1')118 self.app['faculties']['fac1']['dep1'] = Department(code=u'dep1') 119 119 self.department = self.app['faculties']['fac1']['dep1'] 120 120 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r10458 r10634 71 71 self.certificate.school_fee_2 = 20000.0 72 72 self.app['faculties']['fac1'] = Faculty(code='fac1') 73 self.app['faculties']['fac1']['dep1'] = Department(code= 'dep1')73 self.app['faculties']['fac1']['dep1'] = Department(code=u'dep1') 74 74 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 75 75 self.certificate) -
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( -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r10561 r10634 28 28 from waeup.kofa.utils.batching import VirtualExportJobContainer 29 29 from waeup.kofa.interfaces import IKofaUtils 30 from waeup.kofa.utils.helpers import attrs_to_fields 30 31 from waeup.kofa.university.interfaces import IDepartment, IDepartmentAdd 31 32 … … 89 90 return longtitle(self) 90 91 92 # Set all attributes of Department required in IDepartment as field 93 # properties. Doing this, we do not have to set initial attributes 94 # ourselves and as a bonus we get free validation when an attribute is 95 # set. 96 Department = attrs_to_fields(Department) 97 91 98 class DepartmentFactory(grok.GlobalUtility): 92 99 """A factory for department containers. -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r10185 r10634 103 103 ) 104 104 105 score_editing_disabled = schema.Bool( 106 title = _(u'Score editing disabled'), 107 description = _( 108 u'Lectures cannnot edit scores if ticked.'), 109 required = False, 110 default = False, 111 ) 112 105 113 courses = Attribute("A container for courses.") 106 114 certificates = Attribute("A container for certificates.")
Note: See TracChangeset for help on using the changeset viewer.