Ignore:
Timestamp:
14 Sep 2011, 01:26:25 (13 years ago)
Author:
uli
Message:

Merge changes from uli-studentpw back into trunk.

Location:
main/waeup.sirp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk

  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py

    r6680 r6756  
    2727from zope.password.interfaces import IPasswordManager
    2828from zope.pluggableauth import PluggableAuthentication
     29from zope.security.interfaces import Unauthorized
    2930from zope.securitypolicy.role import Role
    3031from zope.securitypolicy.interfaces import IRole, Allow
     
    3334from waeup.sirp.students.authentication import (
    3435    StudentsAuthenticatorSetup, StudentAccount)
    35 
     36from waeup.sirp.students.tests.test_browser import StudentsFullSetup
     37from waeup.sirp.testing import FunctionalLayer
    3638
    3739class StudentsAuthenticatorSetupTests(unittest.TestCase):
     
    152154        self.assertEqual(self.account.roles, ['waeup.test.Role'])
    153155        return
     156
     157
     158
     159class FunctionalStudentAuthTests(StudentsFullSetup):
     160
     161    layer = FunctionalLayer
     162
     163    def setUp(self):
     164        super(FunctionalStudentAuthTests, self).setUp()
     165        return
     166
     167    def tearDown(self):
     168        super(FunctionalStudentAuthTests, self).tearDown()
     169        return
     170
     171    def test_reset_protected_anonymous(self):
     172        # anonymous users cannot reset others passwords
     173        self.assertRaises(
     174            Unauthorized,
     175            self.browser.open, self.student_path + '/bedit')
     176        return
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r6753 r6756  
    279279        # Change password
    280280        self.browser.getLink("Change password").click()
    281         self.browser.getControl(name="password").value = 'new_password'
    282         self.browser.getControl(name="control_password").value = 'new_password'
     281        self.browser.getControl(name="form.password").value = 'new_password'
     282        self.browser.getControl(
     283            name="form.password_repeat").value = 'new_password'
    283284        self.browser.getControl("Save").click()
    284285        self.assertTrue('Form has been saved' in self.browser.contents)
     
    294295        self.browser.open(self.login_path)
    295296        self.browser.getControl(name="form.login").value = self.test_student_id
    296         self.browser.getControl(name="password").value = 'new_password'
     297        self.browser.getControl(name="form.password").value = 'new_password'
    297298        self.browser.getControl("Login").click()
    298299        self.assertEqual(self.browser.url, self.student_path)
Note: See TracChangeset for help on using the changeset viewer.