Changeset 7124 for main


Ignore:
Timestamp:
17 Nov 2011, 11:01:25 (13 years ago)
Author:
Henrik Bettermann
Message:

Use a constraint for password validation.

It seems that the constraint does not comply with the PasswordChangeCredentialsPlugin?. The test fails because the new credentials have been set although the form validation failed.

What shall we do?

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

Legend:

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

    r7114 r7124  
    6666    """
    6767
     68    def validPassword(value):
     69        return len(value) > 3
     70
    6871    password = schema.Password(
    6972        title = u'New password',
    7073        required = False,
     74        constraint = validPassword,
    7175        )
    7276
     
    7478        title = u'Retype new password',
    7579        required = False,
     80        constraint = validPassword,
    7681        )
    7782
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7123 r7124  
    650650        # Change password
    651651        self.browser.getLink("Change password").click()
     652        self.browser.getControl(name="form.password").value = 'pw'
     653        self.browser.getControl(
     654            name="form.password_repeat").value = 'pw'
     655        self.browser.getControl("Save").click()
     656        self.assertTrue('Constraint not satisfied' in self.browser.contents)
    652657        self.browser.getControl(name="form.password").value = 'new_password'
    653658        self.browser.getControl(
Note: See TracChangeset for help on using the changeset viewer.