- Timestamp:
- 22 Jul 2012, 05:07:30 (12 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/sample_student_data.csv
r8862 r9041 1 firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex 2 Aaren,Pieri,1,,100000,aa@aa.ng,1234,m 3 Aaren,Finau,2,,100001,aa@aa.ng,1234,m 4 Aaren,Berson,3,,100002,aa@aa.ng,1234,m 1 firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,nationality 2 Aaren,Pieri,1,,100000,aa@aa.ng,1234,m,DE 3 Aaren,Finau,2,,100001,aa@aa.ng,1234,m,NG 4 Aaren,Berson,3,,100002,aa@aa.ng,1234,m,FR -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
r8863 r9041 20 20 import tempfile 21 21 from StringIO import StringIO 22 from hurry.workflow.interfaces import IWorkflowState 22 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo 23 23 from zope.component.hooks import setSite, clearSite 24 24 from zope.component import getUtility, createObject … … 105 105 layer = FunctionalLayer 106 106 107 def setUp(self): 108 super(StudentUITests, self).setUp() 109 self.student.nationality = u'DE' 110 107 111 def test_classes(self): 108 112 # Let's see if objects created in the customized … … 184 188 # Students can edit clearance data 185 189 IWorkflowState(self.student).setState('cleared') 186 self.student.clearance_locked = False187 190 self.browser.open(self.login_path) 188 191 self.browser.getControl(name="form.login").value = self.student_id … … 203 206 self.browser.open(self.student_path + '/change_portrait') 204 207 self.assertTrue('The requested form is locked' in self.browser.contents) 205 # Student can view and edit clearance data 208 209 # Student can view and edit clearance data if clearance has started 210 IWorkflowInfo(self.student).fireTransition('start_clearance') 206 211 self.browser.getLink("Clearance Data").click() 207 212 self.browser.getLink("Edit").click() 208 213 self.assertTrue('Save' in self.browser.contents) 214 215 # Clearance can only be requested if all required documents 216 # have been uploaded. 217 self.browser.getControl("Save and request clearance").click() 218 self.assertTrue('No birth certificate uploaded' in self.browser.contents) 219 birth_certificate = 'My birth certificate' 220 file_id = IFileStoreNameChooser(self.student).chooseName( 221 attr="birth_certificate.jpg") 222 file_store.createFile(file_id, StringIO(birth_certificate)) 223 self.browser.open(self.edit_clearance_path) 224 self.browser.getControl("Save and request clearance").click() 225 226 self.assertTrue('No referee letter uploaded' in self.browser.contents) 227 ref_let = 'My ref let' 228 file_id = IFileStoreNameChooser(self.student).chooseName( 229 attr="ref_let.jpg") 230 file_store.createFile(file_id, StringIO(ref_let)) 231 self.browser.open(self.edit_clearance_path) 232 self.browser.getControl("Save and request clearance").click() 233 234 self.assertTrue('No acceptance letter uploaded' in self.browser.contents) 235 acc_let = 'My acc let' 236 file_id = IFileStoreNameChooser(self.student).chooseName( 237 attr="acc_let.jpg") 238 file_store.createFile(file_id, StringIO(acc_let)) 239 self.browser.open(self.edit_clearance_path) 240 self.browser.getControl("Save and request clearance").click() 241 242 self.assertTrue('No first sitting result uploaded' in self.browser.contents) 243 fst_sit_scan = 'My first sitting result' 244 file_id = IFileStoreNameChooser(self.student).chooseName( 245 attr="fst_sit_scan.jpg") 246 file_store.createFile(file_id, StringIO(fst_sit_scan)) 247 self.browser.open(self.edit_clearance_path) 248 self.browser.getControl("Save and request clearance").click() 249 self.assertTrue('Enter the CLR access code used for starting clearance' 250 in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.