- Timestamp:
- 2 May 2013, 05:30:25 (12 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants/tests/test_browser.py
r10132 r10133 53 53 setSite(app) 54 54 55 # Add nd applicants container56 self.nd container = ApplicantsContainer()57 self.nd container.mode = 'create'58 self.nd container.code = u'nd2011'59 self.nd container.prefix = u'nd'60 self.nd container.application_category = u'nd'61 self.nd container.year = 201162 self.nd container.application_fee = 300.063 self.nd container.title = u'This is the nd2011 container'64 self.app['applicants']['nd 2011'] = self.ndcontainer55 # Add ndft applicants container 56 self.ndftcontainer = ApplicantsContainer() 57 self.ndftcontainer.mode = 'create' 58 self.ndftcontainer.code = u'ndft2011' 59 self.ndftcontainer.prefix = u'ndft' 60 self.ndftcontainer.application_category = u'ndft' 61 self.ndftcontainer.year = 2011 62 self.ndftcontainer.application_fee = 300.0 63 self.ndftcontainer.title = u'This is the ndft2011 container' 64 self.app['applicants']['ndft2011'] = self.ndftcontainer 65 65 66 66 delta = datetime.timedelta(days=10) 67 self.nd container.startdate = datetime.datetime.now(pytz.utc) - delta68 self.nd container.enddate = datetime.datetime.now(pytz.utc) + delta67 self.ndftcontainer.startdate = datetime.datetime.now(pytz.utc) - delta 68 self.ndftcontainer.enddate = datetime.datetime.now(pytz.utc) + delta 69 69 70 70 # Populate university 71 71 self.certificate = createObject('waeup.Certificate') 72 72 self.certificate.code = 'CERT1' 73 self.certificate.application_category = 'nd '73 self.certificate.application_category = 'ndft' 74 74 self.certificate.start_level = 100 75 75 self.certificate.end_level = 500 … … 81 81 82 82 # Add (customized) applicants 83 nd applicant = createObject(u'waeup.Applicant')84 nd applicant.firstname = u'Anna'85 nd applicant.lastname = u'Post'86 self.app['applicants']['nd 2011'].addApplicant(ndapplicant)87 self.nd application_number = ndapplicant.application_number88 self.nd applicant = self.app['applicants']['nd2011'][89 self.nd application_number]90 self.nd applicant_path = ('http://localhost/app/applicants/nd2011/%s'91 % self.nd application_number)83 ndftapplicant = createObject(u'waeup.Applicant') 84 ndftapplicant.firstname = u'Anna' 85 ndftapplicant.lastname = u'Post' 86 self.app['applicants']['ndft2011'].addApplicant(ndftapplicant) 87 self.ndftapplication_number = ndftapplicant.application_number 88 self.ndftapplicant = self.app['applicants']['ndft2011'][ 89 self.ndftapplication_number] 90 self.ndftapplicant_path = ('http://localhost/app/applicants/ndft2011/%s' 91 % self.ndftapplication_number) 92 92 93 93 self.browser = Browser() … … 111 111 112 112 def test_manage_and_view_applicant(self): 113 # Managers can manage nd applicants.113 # Managers can manage ndft applicants. 114 114 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 115 self.browser.open(self.nd applicant_path)115 self.browser.open(self.ndftapplicant_path) 116 116 self.assertEqual(self.browser.headers['Status'], '200 Ok') 117 117 self.assertTrue("'O' Level" in self.browser.contents) 118 118 self.assertFalse("Higher" in self.browser.contents) 119 self.browser.open(self.nd applicant_path + '/manage')119 self.browser.open(self.ndftapplicant_path + '/manage') 120 120 self.assertEqual(self.browser.headers['Status'], '200 Ok') 121 121 self.assertTrue("'O' Level" in self.browser.contents) 122 122 self.assertTrue("Higher" in self.browser.contents) 123 self.browser.open(self.nd applicant_path + '/edit')123 self.browser.open(self.ndftapplicant_path + '/edit') 124 124 self.assertEqual(self.browser.headers['Status'], '200 Ok') 125 125 self.assertTrue("'O' Level" in self.browser.contents) 126 126 self.assertFalse("Higher" in self.browser.contents) 127 self.browser.open(self.nd applicant_path + '/application_slip.pdf')127 self.browser.open(self.ndftapplicant_path + '/application_slip.pdf') 128 128 self.assertEqual(self.browser.headers['Status'], '200 Ok') 129 # Now we turn the nd applicant into an hndapplicant.130 self.nd applicant.applicant_id = u'hnd_anything'131 self.browser.open(self.nd applicant_path)129 # Now we turn the ndft applicant into an hndft applicant. 130 self.ndftapplicant.applicant_id = u'hndft_anything' 131 self.browser.open(self.ndftapplicant_path) 132 132 self.assertTrue("Higher" in self.browser.contents) 133 133 self.assertTrue("'O' Level" in self.browser.contents) 134 self.browser.open(self.nd applicant_path + '/edit')134 self.browser.open(self.ndftapplicant_path + '/edit') 135 135 self.assertTrue("Higher" in self.browser.contents) 136 136 self.assertTrue("'O' Level" in self.browser.contents) -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants/utils.py
r10132 r10133 32 32 33 33 APP_TYPES_DICT = { 34 'prend': ['Pre-ND Programme', 'RP'], 35 'hnd': ['HND Programmes', 'hnd'], 36 'nd': ['ND Programmes', 'nd'], 34 'rmd': ['Remedial Programme', 'RP'], 35 'hndft': ['HND Full-Time Programmes', 'HNDFT'], 36 'hndpt': ['HND Part-Time Programmes', 'HNDPT'], 37 'ndft': ['ND Full-Time Programmes', 'NDFT'], 38 'ndpt': ['ND Part-Time Programmes', 'NDPT'], 37 39 'putme': ['Post-UTME Screening Exercise', 'PUTME'], 38 40 'app': ['General Studies', 'APP'],
Note: See TracChangeset for help on using the changeset viewer.