Changeset 5892


Ignore:
Timestamp:
30 Mar 2011, 10:27:20 (14 years ago)
Author:
uli
Message:

Add login tests for manager user.

File:
1 edited

Legend:

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

    r5890 r5892  
    9494        return
    9595
     96    def test_manager_no_warnings(self):
     97        # Browsing the login screen as a manager, won't raise warnings
     98        path = 'http://localhost/app/applicants/testapplicants/login'
     99        # Authenticate ourself as manager
     100        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     101        self.browser.open(path)
     102        # Submit the form w/o any credentials
     103        self.browser.getControl(name="SUBMIT").click()
     104        self.assertTrue(
     105            'Entered credentials are invalid' not in self.browser.contents)
     106        return
     107
     108    def test_manager_no_redirect(self):
     109        # Browsing the login screen as a manager won't trigger a redirect
     110        path = 'http://localhost/app/applicants/testapplicants/login'
     111        # Authenticate ourself as manager
     112        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     113        self.browser.open(path)
     114        # Submit the form w/o any credentials
     115        self.browser.getControl(name="SUBMIT").click()
     116        self.assertEqual(
     117            self.browser.url,
     118            'http://localhost/app/applicants/testapplicants/login'
     119            )
     120        return
     121       
    96122def suite():
    97123    suite = unittest.TestSuite()
Note: See TracChangeset for help on using the changeset viewer.