Changeset 8314 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 30 Apr 2012, 06:00:27 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv
r8033 r8314 1 code,title,prefix, entry_level,year,application_category,description,startdate,enddate,strict_deadline,mode2 app2012,General Studies 2012/2013,app, 100,2012,basic,"This text can been seen by anonymous users.1 code,title,prefix,year,application_category,description,startdate,enddate,strict_deadline,mode 2 app2012,General Studies 2012/2013,app,2012,basic,"This text can been seen by anonymous users. 3 3 >>de<< 4 4 Dieser Text kann von anonymen Benutzern gelesen werden.",2012-03-01,2012-04-25,1,create 5 app2013,General Studies 2013/2014,app, 100,2012,basic,"This text can been seen by anonymous users.5 app2013,General Studies 2013/2014,app,2012,basic,"This text can been seen by anonymous users. 6 6 >>de<< 7 7 Dieser Text kann von anonymen Benutzern gelesen werden.",2013-03-01,2013-04-25,1,create -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
r7811 r8314 20 20 """ 21 21 import os 22 from hurry.workflow.interfaces import IWorkflowInfo 22 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 23 23 from zope.component import getUtility 24 24 from waeup.kofa.testing import FunctionalLayer … … 54 54 (success, msg) = self.applicant.createStudent() 55 55 self.assertTrue(msg == 'Applicant has not yet been admitted.') 56 IWorkflowInfo(self.applicant).fireTransition('start') 57 IWorkflowInfo(self.applicant).fireTransition('pay') 58 IWorkflowInfo(self.applicant).fireTransition('submit') 59 IWorkflowInfo(self.applicant).fireTransition('admit') 56 IWorkflowState(self.applicant).setState('admitted') 60 57 (success, msg) = self.applicant.createStudent() 61 58 self.assertTrue(msg == 'No course admitted provided.') … … 99 96 self.assertMatches('...John Tester...', self.browser.contents) 100 97 98 def test_batch_copying(self): 99 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 100 self.browser.open(self.manage_path) 101 self.fill_correct_values() 102 self.browser.getControl("Save").click() 103 # Upload a passport picture 104 ctrl = self.browser.getControl(name='form.passport') 105 file_obj = open( 106 os.path.join(os.path.dirname(__file__), 'test_image.jpg'),'rb') 107 file_ctrl = ctrl.mech_control 108 file_ctrl.add_file(file_obj, filename='my_photo.jpg') 109 self.browser.getControl("Save").click() # submit form 110 IWorkflowState(self.applicant).setState('admitted') 111 self.browser.getControl(name="form.course_admitted").value = ['CERT1'] 112 self.browser.getControl("Save").click() 113 self.browser.open(self.manage_container_path) 114 self.browser.getControl("Create students from selected", index=0).click() 115 self.assertTrue('No applicant selected' in self.browser.contents) 116 ctrl = self.browser.getControl(name='val_id') 117 ctrl.getControl(value=self.applicant.application_number).selected = True 118 self.browser.getControl("Create students from selected", index=0).click() 119 self.assertTrue('1 students successfully created' in self.browser.contents) 120 101 121 def test_copier_wo_passport(self): 102 122 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 104 124 self.fill_correct_values() 105 125 # Let's try to create the student 106 IWorkflowInfo(self.applicant).fireTransition('start') 107 IWorkflowInfo(self.applicant).fireTransition('pay') 108 IWorkflowInfo(self.applicant).fireTransition('submit') 109 IWorkflowInfo(self.applicant).fireTransition('admit') 126 IWorkflowState(self.applicant).setState('admitted') 110 127 self.browser.getControl(name="form.course_admitted").value = ['CERT1'] 111 128 self.browser.getControl("Save").click()
Note: See TracChangeset for help on using the changeset viewer.