Changeset 8668 for main/waeup.uniben/trunk/src
- Timestamp:
- 11 Jun 2012, 06:42:14 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py
r8530 r8668 30 30 grok.provides(ICustomApplicant) 31 31 32 create_names = Applicant.create_names + [ 33 'lga', 'nationality', 'perm_address'] 34 32 35 # Set all attributes of Applicant required in IApplicant as field 33 36 # properties. Doing this, we do not have to set initial attributes -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8630 r8668 192 192 193 193 def _redirect(self, email, password, applicant_id): 194 # Forward onlyemail and credentials to landing page.194 # Forward email and credentials to landing page. 195 195 self.redirect(self.url(self.context, 'registration_complete', 196 196 data = dict(email=email, password=password, -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r8646 r8668 312 312 313 313 def createStudent(): 314 """Create a student object from applica tnt data314 """Create a student object from applicant data 315 315 and copy applicant object. 316 316 """ -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py
r8630 r8668 29 29 from zope.catalog.interfaces import ICatalog 30 30 from zope.testbrowser.testing import Browser 31 from hurry.workflow.interfaces import IWorkflowState 31 32 from waeup.kofa.app import University 32 33 from waeup.kofa.university.faculty import Faculty … … 93 94 self.certificate.start_level = 100 94 95 self.certificate.end_level = 500 96 self.certificate.study_mode = u'ug_ft' 95 97 self.app['faculties']['fac1'] = Faculty() 96 98 self.app['faculties']['fac1']['dep1'] = Department() … … 102 104 self.certificate2.start_level = 100 103 105 self.certificate2.end_level = 500 106 self.certificate.study_mode = u'pg_ft' 104 107 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 105 108 self.certificate2) … … 141 144 self.browser.getControl(name="form.date_of_birth").value = '09/09/1988' 142 145 self.browser.getControl(name="form.lga").value = ['foreigner'] 146 self.browser.getControl(name="form.nationality").value = ['NG'] 143 147 self.browser.getControl(name="form.sex").value = ['m'] 144 148 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 252 256 reg_number=(applicant.reg_number, applicant.reg_number))) 253 257 self.assertEqual(applicant,results[0]) 258 return 259 260 def test_create_ugstudent(self): 261 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 262 manage_path = 'http://localhost/app/applicants/%s/%s/%s' % ( 263 'app2011', self.ugapplicant.application_number, 'manage') 264 self.browser.open(manage_path) 265 self.fill_correct_values() 266 self.browser.getControl("Save").click() 267 IWorkflowState(self.ugapplicant).setState('admitted') 268 self.browser.getControl(name="form.course1").value = ['CERT1'] 269 self.browser.getControl(name="form.course_admitted").value = ['CERT1'] 270 self.browser.getControl("Save").click() 271 self.browser.getLink("Create student").click() 272 student_id = self.app['students'].keys()[0] 273 self.assertTrue(('Student %s created' % student_id) 274 in self.browser.contents) 275 student = self.app['students'][student_id] 276 self.assertEqual(student.email, 'xx@yy.zz') 277 self.assertEqual(student.firstname, 'John') 278 self.assertEqual(student.lastname, 'Tester') 279 # Also additional attributes have been copied. 280 self.assertEqual(student.lga, 'foreigner') 281 self.assertEqual(student.nationality, 'NG') 254 282 return 255 283
Note: See TracChangeset for help on using the changeset viewer.