Changeset 13394 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 6 Nov 2015, 05:43:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13349 r13394 1387 1387 filewidget.add_file(filecontents, 'text/plain', 'students.csv') 1388 1388 self.browser.getControl(name='SUBMIT').click() 1389 self.browser.getLink("Switch maintenance mode").click() 1389 1390 self.browser.getLink('Process data').click() 1390 1391 button = lookup_submit_value( … … 1413 1414 filewidget.add_file(filecontents, 'text/plain', 'studycourses.csv') 1414 1415 self.browser.getControl(name='SUBMIT').click() 1416 # Meanwhile maintenance mode is disabled again. 1417 self.browser.getLink("Switch maintenance mode").click() 1415 1418 self.browser.getLink('Process data').click() 1416 1419 button = lookup_submit_value( … … 2376 2379 '...You logged in...', self.browser.contents) 2377 2380 2381 def test_maintenance_mode(self): 2382 config = grok.getSite()['configuration'] 2383 self.browser.open(self.login_path) 2384 self.browser.getControl(name="form.login").value = self.student_id 2385 self.browser.getControl(name="form.password").value = 'spwd' 2386 self.browser.getControl("Login").click() 2387 # Student logged in. 2388 self.assertTrue('You logged in' in self.browser.contents) 2389 self.assertTrue("Anna Tester" in self.browser.contents) 2390 # If maintenance mode is enabled, student is immediately logged out. 2391 config.maintmode_enabled_by = u'any_user' 2392 self.assertRaises( 2393 Unauthorized, self.browser.open, 'http://localhost/app/faculties') 2394 self.browser.open('http://localhost/app/login') 2395 self.assertTrue('The portal is in maintenance mode' in self.browser.contents) 2396 # Student really can't login if maintenance mode is enabled. 2397 self.browser.open(self.login_path) 2398 self.browser.getControl(name="form.login").value = self.student_id 2399 self.browser.getControl(name="form.password").value = 'spwd' 2400 self.browser.getControl("Login").click() 2401 # A second warning is raised. 2402 self.assertTrue( 2403 'The portal is in maintenance mode. You can\'t login!' 2404 in self.browser.contents) 2405 return 2406 2378 2407 def test_student_clearance(self): 2379 2408 # Student cant login if their password is not set
Note: See TracChangeset for help on using the changeset viewer.