Changeset 14274 for main/kofacustom.nigeria/trunk
- Timestamp:
- 15 Nov 2016, 09:12:51 (8 years ago)
- Location:
- main/kofacustom.nigeria/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/CHANGES.txt
r13683 r14274 4 4 1.3.dev0 (unreleased) 5 5 ===================== 6 7 - Add `provisionally_cleared` field an allow students to edit 8 their clearance data if set. 6 9 7 10 - Add fields, permissions, browser views and buttons to enable -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r14163 r14274 65 65 """ 66 66 form_fields = grok.AutoFields(INigeriaStudentBase).omit( 67 'password', 'suspended', 'suspended_comment', 'flash_notice') 67 'password', 'suspended', 'suspended_comment', 68 'flash_notice', 'provisionally_cleared') 68 69 form_fields[ 69 70 'financial_clearance_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py
r14101 r14274 67 67 ) 68 68 69 provisionally_cleared = schema.Bool( 70 title = _(u'Provisionally Cleared'), 71 default = False, 72 required = False, 73 description = u'Student will be able to edit clearance data if set.', 74 ) 75 69 76 INigeriaStudentBase['reg_number'].order = IStudentBase[ 70 77 'reg_number'].order -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/student.py
r10268 r14274 23 23 from waeup.kofa.utils.helpers import attrs_to_fields 24 24 from waeup.kofa.students.student import Student, StudentFactory 25 from waeup.kofa.interfaces import CLEARANCE 25 26 from kofacustom.nigeria.students.interfaces import ( 26 27 INigeriaStudent, IStudentNavigation, INigeriaStudentPersonalEdit) … … 43 44 return False 44 45 46 @property 47 def clearance_locked(self): 48 return self.state != CLEARANCE and not self.provisionally_cleared 49 45 50 # Set all attributes of Student required in IStudent as field 46 51 # properties. Doing this, we do not have to set initial attributes -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
r13856 r14274 454 454 print "Sample PDF fee_payment_history.pdf written to %s" % path 455 455 return 456 457 def test_provisionally_cleared(self): 458 # Students can edit clearance data 459 IWorkflowState(self.student).setState('school fee paid') 460 self.browser.open(self.login_path) 461 self.browser.getControl(name="form.login").value = self.student_id 462 self.browser.getControl(name="form.password").value = 'spwd' 463 self.browser.getControl("Login").click() 464 # Student can't access the clearance form 465 self.browser.open(self.student_path) 466 self.browser.getLink("Clearance Data").click() 467 # Student can't open clearance edit form before starting clearance 468 self.browser.open(self.student_path + '/cedit') 469 self.assertMatches('...The requested form is locked...', 470 self.browser.contents) 471 self.assertFalse( 472 '<h1 class="kofa-content-label">Edit clearance data</h1>' 473 in self.browser.contents) 474 # If provisionally_cleared is set they can 475 self.student.provisionally_cleared = True 476 self.browser.getLink("Clearance Data").click() 477 self.browser.getLink("Edit").click() 478 self.assertTrue( 479 '<h1 class="kofa-content-label">Edit clearance data</h1>' 480 in self.browser.contents) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py
r13712 r14274 78 78 'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,' 79 79 'nysc_lga,nysc_location,nysc_year,officer_comment,' 80 'perm_address,personal_updated,phone,physical_clearance_date,reg_number,' 80 'perm_address,personal_updated,phone,physical_clearance_date,' 81 'provisionally_cleared,reg_number,' 81 82 'religion,scd_sit_date,scd_sit_fname,scd_sit_no,' 82 83 'scd_sit_results,scd_sit_type,sex,student_id,' … … 86 87 'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'accounts\', \'A\')]"' 87 88 ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,' 88 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,, 123,,,,,'89 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,' 89 90 '"[(\'accounts\', \'A\')]",,f,A111111,0,,,created,' 90 91 '[u\'2012-11-06 13:16:41 WAT - Record created by system\'],'
Note: See TracChangeset for help on using the changeset viewer.