Ignore:
Timestamp:
19 Sep 2011, 14:10:10 (13 years ago)
Author:
Henrik Bettermann
Message:

Improve test coverage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6799 r6800  
    175175            return
    176176        elif student_pw:
    177             self.flash('Password has already been set.')
     177            self.flash('Password has already been set. You are using the wrong Access Code.')
    178178            return
    179179        # Mark pin as used (this also fires a pin related transition)
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r6799 r6800  
    311311        self.browser.getControl(name="form.current_level").value = ['100']
    312312        self.browser.getControl("Save").click()
    313         # Managers can add a any study level (course list)
     313        # Managers can add and remove any study level (course list)
    314314        self.browser.getControl(name="addlevel").value = ['100']
    315315        self.browser.getControl("Add study level").click()
    316316        self.assertMatches('...<span>100</span>...', self.browser.contents)
     317        self.browser.getControl(name="val_id").value = ['100']
     318        self.browser.getControl("Remove selected").click()
     319        self.assertMatches('...Successfully removed...', self.browser.contents)
     320        # Add again level again
     321        self.browser.getControl(name="addlevel").value = ['100']
     322        self.browser.getControl("Add study level").click()
     323
    317324        # Managers can view and manage course lists
    318325        self.browser.getLink("100").click()
     
    419426        self.browser.getControl(name="ac_series").value = self.existing_pwdseries
    420427        self.browser.getControl(name="ac_number").value = self.existing_pwdnumber
     428        self.browser.getControl(name="reg_number").value = '223456'
     429        self.browser.getControl("Show").click()
     430        self.assertMatches('...No student found...',
     431                           self.browser.contents)
     432        self.browser.getControl(name="reg_number").value = '123456'
     433        self.browser.getControl(name="ac_number").value = '999999'
     434        self.browser.getControl("Show").click()
     435        self.assertMatches('...Access code is invalid...',
     436                           self.browser.contents)
     437        self.browser.getControl(name="ac_number").value = self.existing_pwdnumber
     438        self.browser.getControl("Show").click()
     439        self.assertMatches('...Password has been set. Your Student Id is...',
     440                           self.browser.contents)
     441        self.browser.getControl("Show").click()
     442        self.assertMatches(
     443            '...Password has already been set. Your Student Id is...',
     444            self.browser.contents)
     445        existing_pwdpin = self.pwdpins[1]
     446        parts = existing_pwdpin.split('-')[1:]
     447        existing_pwdseries, existing_pwdnumber = parts
     448        self.browser.getControl(name="ac_series").value = existing_pwdseries
     449        self.browser.getControl(name="ac_number").value = existing_pwdnumber
    421450        self.browser.getControl(name="reg_number").value = '123456'
    422451        self.browser.getControl("Show").click()
    423         self.assertMatches('...Password has been set. Your Student Id is...',
    424                            self.browser.contents)
     452        self.assertMatches(
     453            '...You are using the wrong Access Code...',
     454            self.browser.contents)
    425455        # The student can login with the new credentials
    426456        self.browser.open(self.login_path)
Note: See TracChangeset for help on using the changeset viewer.