Changeset 13091 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 23 Jun 2015, 05:58:58 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r13080 r13091 275 275 email = schema.ASCIILine( 276 276 title = _(u'Email'), 277 required = False,277 required = True, 278 278 constraint=validate_email, 279 279 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13076 r13091 35 35 from zope.securitypolicy.interfaces import IPrincipalRoleManager 36 36 from zope.testbrowser.testing import Browser 37 from zope.interface import implementedBy 38 from zope.schema.fieldproperty import FieldProperty 37 39 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 38 40 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase … … 546 548 # Managers can contact student 547 549 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 550 # Remove required FieldProperty attribute first ... 551 delattr(Student, 'email') 552 # ... and replace by None 548 553 self.student.email = None 554 # Now we have to add the FieldProperty attribute again. Otherwise 555 # many other tests below will fail. 556 iface = list(implementedBy(Student))[0] 557 field_property = FieldProperty(iface['email']) 558 setattr(Student, 'email', field_property) 549 559 self.browser.open(self.student_path) 550 560 self.browser.getLink("Send email").click() … … 2400 2410 self.browser.getLink("Clearance Data").click() 2401 2411 self.browser.getLink("Start clearance").click() 2402 self.student.email = None 2403 # Uups, we forgot to fill the email fields 2412 self.student.phone = None 2413 # Uups, we forgot to fill the phone fields 2414 # (email is already required in the interface, but phone not) 2404 2415 self.browser.getControl("Start clearance").click() 2405 2416 self.assertMatches('...Not all required fields filled...', 2406 2417 self.browser.contents) 2407 2418 self.browser.open(self.student_path + '/edit_base') 2408 self.browser.getControl(name="form. email").value = 'aa@aa.ng'2419 self.browser.getControl(name="form.phone.ext").value = '12345' 2409 2420 self.browser.getControl("Save").click() 2410 2421 self.browser.open(self.student_path + '/start_clearance')
Note: See TracChangeset for help on using the changeset viewer.