- Timestamp:
- 6 Nov 2015, 05:43:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13365 r13394 609 609 self.assertTrue( 610 610 'You logged in.' in self.browser.contents) 611 612 def test_maintenance_mode(self): 613 config = grok.getSite()['configuration'] 614 self.login() 615 # Applicant logged in. 616 self.assertTrue('You logged in' in self.browser.contents) 617 self.assertTrue("Joan None" in self.browser.contents) 618 # If maintenance mode is enabled, applicant is immediately logged out. 619 config.maintmode_enabled_by = u'any_user' 620 self.assertRaises( 621 Unauthorized, self.browser.open, 'http://localhost/app/faculties') 622 self.browser.open('http://localhost/app/login') 623 self.assertTrue('The portal is in maintenance mode' in self.browser.contents) 624 # Applicant really can't login if maintenance mode is enabled. 625 self.login() 626 # A second warning is raised. 627 self.assertTrue( 628 'The portal is in maintenance mode. You can\'t login!' 629 in self.browser.contents) 630 return 611 631 612 632 def test_applicant_access(self): … … 1250 1270 1251 1271 def test_register_applicant_create(self): 1272 config = grok.getSite()['configuration'] 1273 config.maintmode_enabled_by = u'any_user' 1252 1274 self.assertEqual(len(self.app['applicants'][container_name_1]), 1) 1253 1275 # An applicant can register himself. 1254 1276 self.browser.open(self.container_path) 1255 1277 self.browser.getLink("Register for application").click() 1256 # Fill the edit form with suitable values 1278 self.assertTrue( 1279 'The portal is in maintenance mode' in self.browser.contents) 1280 config.maintmode_enabled_by = None 1281 self.browser.getLink("Register for application").click() 1282 # The edit form now opens and can be filled with suitable values 1257 1283 self.browser.getControl(name="form.firstname").value = 'Anna' 1258 1284 self.browser.getControl(name="form.lastname").value = 'Kurios'
Note: See TracChangeset for help on using the changeset viewer.