Ignore:
Timestamp:
15 Jun 2012, 06:48:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Merged with waeup.uniben 8726:8727.

Location:
main/waeup.futminna/trunk/src/waeup/futminna
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna

  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests.py

    r8670 r8730  
    2525from zope.intid.interfaces import IIntIds
    2626from zope.interface.verify import verifyClass, verifyObject
     27from zope.schema.interfaces import ConstraintNotSatisfied
    2728from zope.component.hooks import setSite, clearSite
    2829from zope.component import createObject, getUtility
     
    149150
    150151    def test_manage_and_view_applicant(self):
    151         # Managers can manage pg applicants
     152        # Managers can manage pg applicants.
    152153        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.
    154155        self.browser.open(self.pgapplicant_path)
    155156        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     
    164165        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    165166        # If we view the applicant in the ug container,
    166         # the employer field doesn't appear
     167        # the employer field doesn't appear.
    167168        self.browser.open(self.ugapplicant_path)
    168169        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     
    170171        self.browser.open(self.ugapplicant_path + '/manage')
    171172        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    172         # We can save the applicant
     173        # We can save the applicant.
    173174        self.fill_correct_values()
    174175        self.browser.getControl(name="form.course1").value = ['CERT1']
     
    181182        self.browser.open(self.ugapplicant_path + '/application_slip.pdf')
    182183        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)
    183195        return
    184196
Note: See TracChangeset for help on using the changeset viewer.