# HG changeset patch # User Søren Løvborg # Date 2015-06-15 17:22:17 # Node ID 17281153a4c0d2ac7126d277798361a1a97ca7cc # Parent c082a017b366a711dd1b248cdd6fa11dbe6d5e2a test_login: Test "Log Out" link diff --git a/kallithea/tests/functional/test_login.py b/kallithea/tests/functional/test_login.py --- a/kallithea/tests/functional/test_login.py +++ b/kallithea/tests/functional/test_login.py @@ -61,6 +61,22 @@ class TestLoginController(TestController self.assertEqual(response.status, '200 OK') response.mustcontain('Users Administration') + def test_logout(self): + response = self.app.post(url(controller='login', action='index'), + {'username': 'test_regular', + 'password': 'test12'}) + + # Verify that a login session has been established. + response = self.app.get(url(controller='login', action='index')) + response = response.follow() + self.assertIn('authuser', response.session) + + response.click('Log Out') + + # Verify that the login session has been terminated. + response = self.app.get(url(controller='login', action='index')) + self.assertNotIn('authuser', response.session) + @parameterized.expand([ ('data:text/html,',), ('mailto:test@example.com',),