Changeset 6782 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 16 Sep 2011, 15:18:55 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6779 r6782 522 522 studylevel.level = int(level_code) 523 523 try: 524 self.context.addStudentStudyLevel(studylevel) 524 self.context.addStudentStudyLevel( 525 self.context.certificate,studylevel) 525 526 except KeyError: 526 527 self.flash('This level exists.') -
main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py
r6775 r6782 23 23 from waeup.sirp.students.interfaces import ( 24 24 IStudentStudyCourse, IStudentNavigation, IStudentStudyLevel) 25 from waeup.sirp.students.studylevel import CourseTicket 25 26 from waeup.sirp.utils.helpers import attrs_to_fields 26 27 … … 38 39 return self.__parent__ 39 40 40 def addStudentStudyLevel(self, studylevel):41 def addStudentStudyLevel(self, cert, studylevel): 41 42 """Add a study level object. 42 43 """ … … 45 46 'StudentStudyCourses contain only IStudentStudyLevel instances') 46 47 self[str(studylevel.level)] = studylevel 48 49 #Create course tickets automatically 50 for key, val in cert.items(): 51 ticket = CourseTicket( 52 val.getCourseCode(), 53 val.course.title, 54 val.level, 55 val.core_or_elective) 56 self[str(studylevel.level)][val.getCourseCode()] = ticket 47 57 return 48 58 -
main/waeup.sirp/trunk/src/waeup/sirp/students/studylevel.py
r6781 r6782 51 51 raise TypeError( 52 52 'StudentStudyLeves contain only ICourseTicket instances') 53 self[ str(courseticket.code)] = courseticket53 self[courseticket.code] = courseticket 54 54 return 55 55 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6779 r6782 283 283 self.browser.getControl("Save").click() 284 284 285 # Managers can add a any sudy level (course list) 286 self.browser.getControl(name="addlevel").value = ['100'] 287 self.browser.getControl("Add study level").click() 288 self.assertMatches('...<span>100</span>...', 289 self.browser.contents) 290 291 # Managers can browse all subobjects 285 292 self.browser.open(self.student_path) 286 293 self.browser.getLink("Payments").click() 287 294 self.assertEqual(self.browser.headers['Status'], '200 Ok') 288 295 self.assertEqual(self.browser.url, self.payments_student_path) 289 290 296 self.browser.open(self.student_path) 291 297 self.browser.getLink("Accommodation").click() 292 298 self.assertEqual(self.browser.headers['Status'], '200 Ok') 293 299 self.assertEqual(self.browser.url, self.accommodation_student_path) 294 295 300 self.browser.open(self.student_path) 296 301 self.browser.getLink("History").click()
Note: See TracChangeset for help on using the changeset viewer.