Changeset 13036
- Timestamp:
- 5 Jun 2015, 14:35:19 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r10480 r13036 21 21 """ 22 22 import grok 23 import pytz 24 from datetime import datetime 23 25 from zope.component.interfaces import IFactory 24 26 from zope.component import createObject 25 27 from zope.interface import implementedBy 26 28 from waeup.kofa.utils.helpers import attrs_to_fields 29 from waeup.kofa.interfaces import CREATED 27 30 from waeup.kofa.students.studylevel import ( 28 31 StudentStudyLevel, CourseTicket, … … 58 61 def gpa_params_rectified(self): 59 62 return self.gpa_params 63 64 @property 65 def course_registration_allowed(self): 66 if self.student.is_fresh: 67 return True 68 try: 69 deadline = grok.getSite()['configuration'][ 70 str(self.level_session)].coursereg_deadline 71 except TypeError, KeyError: 72 return True 73 payment_made = False 74 if len(self.student['payments']): 75 for ticket in self.student['payments'].values(): 76 if ticket.p_category == 'late_registration' and \ 77 ticket.p_session == self.level_session and \ 78 ticket.p_state == 'paid': 79 payment_made = True 80 if deadline and deadline < datetime.now(pytz.utc) and not payment_made: 81 return False 82 return True 60 83 61 84 CustomStudentStudyLevel = attrs_to_fields( -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13035 r13036 264 264 '2004'].coursereg_deadline = datetime.now(pytz.utc) - delta 265 265 IWorkflowState(self.student).setState('school fee paid') 266 # Current session is 2004. Here we test course registration for 267 # returning students. 268 self.student['studycourse'].entry_session = 2003 266 269 self.browser.open(self.login_path) 267 270 self.browser.getControl(name="form.login").value = self.student_id … … 290 293 self.assertTrue('Course list has been registered' in self.browser.contents) 291 294 self.assertEqual(self.student.state, 'courses registered') 295 # Reset student and check if fresh students are always allowed to 296 # register courses. 297 self.student['studycourse'].entry_session = 2004 298 del self.student['payments'][value] 299 IWorkflowState(self.student).setState('school fee paid') 300 self.browser.open(self.studycourse_path + '/100/edit') 301 self.browser.getControl("Register course list").click() 302 self.assertTrue('Course list has been registered' in self.browser.contents) 303 return 304 292 305 293 306 def deactivated_test_student_course_registration(self): 294 295 307 # Add more courses 296 308 self.course2 = createObject('waeup.Course')
Note: See TracChangeset for help on using the changeset viewer.