Changeset 6755 for main


Ignore:
Timestamp:
14 Sep 2011, 00:57:50 (13 years ago)
Author:
uli
Message:

Add first (not yet complete) tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/tests/test_authentication.py

    r6680 r6755  
    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
Note: See TracChangeset for help on using the changeset viewer.