Changeset 8669
- Timestamp:
- 11 Jun 2012, 07:06:40 (12 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/applicant.py
r8532 r8669 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.aaue/trunk/src/waeup/aaue/applicants/tests.py
r8623 r8669 20 20 import tempfile 21 21 import datetime 22 import grok 23 import pytz 24 from zope.event import notify 22 25 from zope.intid.interfaces import IIntIds 23 26 from zope.interface.verify import verifyClass, verifyObject … … 26 29 from zope.catalog.interfaces import ICatalog 27 30 from zope.testbrowser.testing import Browser 31 from hurry.workflow.interfaces import IWorkflowState 28 32 from waeup.kofa.app import University 29 33 from waeup.kofa.university.faculty import Faculty … … 79 83 self.app['applicants']['app2011'] = self.ugcontainer 80 84 85 self.ugcontainer.mode = 'update' 86 delta = datetime.timedelta(days=10) 87 self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta 88 self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta 89 81 90 # Populate university 82 91 self.certificate = createObject('waeup.Certificate') … … 85 94 self.certificate.start_level = 100 86 95 self.certificate.end_level = 500 96 self.certificate.study_mode = u'ug_ft' 87 97 self.app['faculties']['fac1'] = Faculty() 88 98 self.app['faculties']['fac1']['dep1'] = Department() … … 94 104 self.certificate2.start_level = 100 95 105 self.certificate2.end_level = 500 106 self.certificate.study_mode = u'pg_ft' 96 107 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 97 108 self.certificate2) … … 133 144 self.browser.getControl(name="form.date_of_birth").value = '09/09/1988' 134 145 self.browser.getControl(name="form.lga").value = ['foreigner'] 146 self.browser.getControl(name="form.nationality").value = ['NG'] 135 147 self.browser.getControl(name="form.sex").value = ['m'] 136 148 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 216 228 self.assertEqual(payment.p_category,'application') 217 229 self.assertEqual(payment.amount_auth, 300.0) 230 return 231 232 def test_create_ugstudent(self): 233 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 234 manage_path = 'http://localhost/app/applicants/%s/%s/%s' % ( 235 'app2011', self.ugapplicant.application_number, 'manage') 236 self.browser.open(manage_path) 237 self.fill_correct_values() 238 self.browser.getControl("Save").click() 239 IWorkflowState(self.ugapplicant).setState('admitted') 240 self.browser.getControl(name="form.course1").value = ['CERT1'] 241 self.browser.getControl(name="form.course_admitted").value = ['CERT1'] 242 self.browser.getControl("Save").click() 243 self.browser.getLink("Create student").click() 244 student_id = self.app['students'].keys()[0] 245 self.assertTrue(('Student %s created' % student_id) 246 in self.browser.contents) 247 student = self.app['students'][student_id] 248 self.assertEqual(student.email, 'xx@yy.zz') 249 self.assertEqual(student.firstname, 'John') 250 self.assertEqual(student.lastname, 'Tester') 251 # Also additional attributes have been copied. 252 self.assertEqual(student.lga, 'foreigner') 253 self.assertEqual(student.nationality, 'NG') 218 254 return 219 255
Note: See TracChangeset for help on using the changeset viewer.