Changeset 9562 for main/kofacustom.nigeria
- Timestamp:
- 6 Nov 2012, 12:23:05 (12 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r9554 r9562 74 74 """ Page to display student personal data 75 75 """ 76 form_fields = grok.AutoFields(INigeriaStudentPersonal) .omit('personal_updated')76 form_fields = grok.AutoFields(INigeriaStudentPersonal) 77 77 form_fields['perm_address'].custom_widget = BytesDisplayWidget 78 78 form_fields['next_kin_address'].custom_widget = BytesDisplayWidget 79 form_fields[ 80 'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le') 79 81 80 82 class NigeriaStudentPersonalEditFormPage(StudentPersonalEditFormPage): -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
r9536 r9562 19 19 import shutil 20 20 import tempfile 21 from datetime import datetime, timedelta 21 22 from StringIO import StringIO 22 23 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo … … 258 259 'acc_let deleted' 259 260 in self.browser.contents) 261 262 def test_student_expired_personal_data(self): 263 # Login 264 delta = timedelta(days=180) 265 self.student.personal_updated = datetime.utcnow() - delta 266 self.browser.open(self.login_path) 267 self.browser.getControl(name="form.login").value = self.student_id 268 self.browser.getControl(name="form.password").value = 'spwd' 269 self.browser.getControl("Login").click() 270 self.assertEqual(self.browser.url, self.student_path) 271 self.assertTrue( 272 'You logged in' in self.browser.contents) 273 # Students don't see personal_updated field in edit form 274 self.browser.open(self.edit_personal_path) 275 self.assertFalse('Updated' in self.browser.contents) 276 self.browser.open(self.personal_path) 277 self.assertTrue('Updated' in self.browser.contents) 278 self.browser.getLink("Logout").click() 279 delta = timedelta(days=181) 280 self.student.personal_updated = datetime.utcnow() - delta 281 self.browser.open(self.login_path) 282 self.browser.getControl(name="form.login").value = self.student_id 283 self.browser.getControl(name="form.password").value = 'spwd' 284 self.browser.getControl("Login").click() 285 self.assertEqual(self.browser.url, self.edit_personal_path) 286 self.assertTrue( 287 'Your personal data record expired' in self.browser.contents) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py
r9535 r9562 45 45 exporter.export_all(self.app, self.outfile) 46 46 result = open(self.outfile, 'rb').read() 47 self.assert True(47 self.assertMatches( 48 48 'adm_code,alr_date,alr_fname,alr_no,alr_results,clearance_locked,' 49 49 'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,' … … 52 52 'fst_sit_date,fst_sit_fname,fst_sit_no,fst_sit_results,' 53 53 'fst_sit_type,hq2_degree,hq2_disc,hq2_matric_no,hq2_school,' 54 'hq2_session,hq2_type,hq_degree,hq_disc,hq_matric_no,hq_school,' 55 'hq_session,hq_type,is_staff,lastname,lga,marit_stat,' 56 'matric_number,middlename,nationality,next_kin_address,' 57 'next_kin_name,next_kin_relation,nysc_lga,nysc_location,' 58 'nysc_year,officer_comment,' 59 'perm_address,phone,reg_number,religion,scd_sit_date,' 60 'scd_sit_fname,scd_sit_no,scd_sit_results,scd_sit_type,sex,' 61 'student_id,suspended,password,state,history,certcode,' 62 'is_postgrad,current_level,current_session\r\n' 63 64 'my adm code,,,,"[(\'visual_art\', \'A1\')]",0,my clr code,' 65 '1981-02-04#,,,anna@sample.com,,,,,,,,,,,Anna,,,,,' 66 '"[(\'visual_art\', \'A1\')]",,,,,,,,,,,,,,,Tester,,,234,M.,NG' 67 ',,,,,,,,"Studentroad 21\nLagos 123456\n",+234-123-12345#,123' 68 ',,,,,"[(\'visual_art\', \'A1\')]",,f,A111111,0,,created,' 69 in result 54 'hq2_session,hq2_type,hq_degree,hq_disc,hq_fname,hq_matric_no,' 55 'hq_school,hq_session,hq_type,is_staff,lastname,lga,' 56 'marit_stat,matric_number,middlename,nationality,' 57 'next_kin_address,next_kin_name,next_kin_relation,' 58 'nysc_lga,nysc_location,nysc_year,officer_comment,' 59 'perm_address,personal_updated,phone,reg_number,' 60 'religion,scd_sit_date,scd_sit_fname,scd_sit_no,' 61 'scd_sit_results,scd_sit_type,sex,student_id,' 62 'suspended,password,state,history,certcode,is_postgrad,' 63 'current_level,current_session\r\nmy adm code,,,,' 64 '"[(\'visual_art\', \'A1\')]",0,my clr code,1981-02-04#,,,' 65 'anna@sample.com,,,,,,,,,,,Anna,,,,,"[(\'visual_art\', \'A1\')]"' 66 ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,' 67 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,,,,,' 68 '"[(\'visual_art\', \'A1\')]",,f,A111111,0,,created,' 69 '[u\'2012-11-06 13:16:41 WAT - Record created by system\'],' 70 'CERT1,0,200,2012\r\n', 71 result 70 72 ) 71 73 return
Note: See TracChangeset for help on using the changeset viewer.