Ignore:
Timestamp:
4 Apr 2012, 06:19:20 (13 years ago)
Author:
Henrik Bettermann
Message:

Verify firstname when registering for application in update mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8033 r8037  
    806806        self.assertEqual(self.browser.url,
    807807            self.container_path + '/registration_complete?email=xx%40yy.zz')
    808         # Now we change the application mode and check if applicants
     808        return
     809
     810    def test_register_applicant_update(self):
     811        # We change the application mode and check if applicants
    809812        # can find and update imported records instead of creating new records.
    810813        # First we check what happens if record can't be found.
    811814        self.applicantscontainer.mode = 'update'
    812815        self.browser.open(self.container_path + '/register')
    813         #self.browser.getControl(name="form.firstname").value = 'John'
     816        self.browser.getControl(name="form.firstname").value = 'John'
    814817        self.browser.getControl(name="form.reg_number").value = 'anynumber'
    815818        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
     
    817820        self.assertTrue('No application record found.'
    818821            in self.browser.contents)
    819         # Now we check if password has already been set.
    820         #self.browser.getControl(name="form.firstname").value = 'John'
     822        # We can't register if password has already been set.
     823        self.browser.getControl(name="form.firstname").value = 'John'
    821824        self.browser.getControl(name="form.reg_number").value = '1234'
    822825        self.browser.getControl("Get login credentials").click()
     
    828831            self.applicant.application_number]).context.password = None
    829832        self.browser.open(self.container_path + '/register')
    830         #self.browser.getControl(name="form.firstname").value = 'John'
     833        self.browser.getControl(name="form.firstname").value = 'John'
    831834        self.browser.getControl(name="form.reg_number").value = '1234'
    832835        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
     836        self.browser.getControl("Get login credentials").click()
     837        self.assertTrue('An error occurred.'in self.browser.contents)
     838        # The firstname attribute was None. Let's set this attribute manually
     839        # and try to register with a wrong name.
     840        self.applicant.firstname = u'John'
     841        self.browser.open(self.container_path + '/register')
     842        self.browser.getControl(name="form.firstname").value = 'Johnny'
     843        self.browser.getControl(name="form.reg_number").value = '1234'
     844        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
     845        self.browser.getControl("Get login credentials").click()
     846        self.assertTrue('No application record found.'
     847            in self.browser.contents)
     848        # Now we use the correct name. For verification
     849        # the name is not case-sensitive.
     850        self.browser.getControl(name="form.firstname").value = 'jOhn'
    833851        self.browser.getControl("Get login credentials").click()
    834852        self.assertTrue('Your registration was successful.'
Note: See TracChangeset for help on using the changeset viewer.