Changeset 8727 for main/waeup.uniben/trunk/src/waeup
- Timestamp:
- 15 Jun 2012, 06:18:42 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r8668 r8727 302 302 ) 303 303 304 class ICustomApplicant(IUGApplicant, IPGApplicant):304 class ICustomApplicant(IUGApplicant, IPGApplicant): 305 305 """An interface for both types of applicants. 306 306 307 Attention: The IPGApplicant field seetings will be overwritten 308 by IPGApplicant field settings. If a field is defined 309 in both interfaces zope.schema validates only against the 310 constraints in IUGApplicant. This does not affect the forms 311 since they are build on either IUGApplicant or IPGApplicant. 307 312 """ 308 313 … … 317 322 318 323 class IUGApplicantEdit(IUGApplicant): 319 """An undergraduate applicant interface for edit ing.324 """An undergraduate applicant interface for edit forms. 320 325 321 326 Here we can repeat the fields from base data and set the -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py
r8668 r8727 25 25 from zope.intid.interfaces import IIntIds 26 26 from zope.interface.verify import verifyClass, verifyObject 27 from zope.schema.interfaces import ConstraintNotSatisfied 27 28 from zope.component.hooks import setSite, clearSite 28 29 from zope.component import createObject, getUtility … … 149 150 150 151 def test_manage_and_view_applicant(self): 151 # Managers can manage pg applicants 152 # Managers can manage pg applicants. 152 153 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 153 # The IPGApplicant interface is really used in all pages 154 # The IPGApplicant interface is really used in all pages. 154 155 self.browser.open(self.pgapplicant_path) 155 156 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 164 165 self.assertEqual(self.browser.headers['Status'], '200 Ok') 165 166 # If we view the applicant in the ug container, 166 # the employer field doesn't appear 167 # the employer field doesn't appear. 167 168 self.browser.open(self.ugapplicant_path) 168 169 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 170 171 self.browser.open(self.ugapplicant_path + '/manage') 171 172 self.assertEqual(self.browser.headers['Status'], '200 Ok') 172 # We can save the applicant 173 # We can save the applicant. 173 174 self.fill_correct_values() 174 175 self.browser.getControl(name="form.course1").value = ['CERT1'] … … 181 182 self.browser.open(self.ugapplicant_path + '/application_slip.pdf') 182 183 self.assertEqual(self.browser.headers['Status'], '200 Ok') 184 return 185 186 def test_set_wrong_course1(self): 187 self.ugapplicant.course1 = self.certificate 188 self.assertRaises( 189 ConstraintNotSatisfied, 190 setattr, self.ugapplicant, 'course1', self.certificate2) 191 self.pgapplicant.course1 = self.certificate2 192 self.assertRaises( 193 ConstraintNotSatisfied, 194 setattr, self.pgapplicant, 'course1', self.certificate) 183 195 return 184 196
Note: See TracChangeset for help on using the changeset viewer.