diff options
| author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2015-08-26 03:07:06 -0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-02-04 10:35:37 -0500 |
| commit | dcee1dfc798bbf4602a35fb73f6acade9f5fd630 (patch) | |
| tree | 3136c20778dc4a06f399bc8af6097f3639510c83 /tests/auth_tests | |
| parent | ad216381fcd7d3d62f1639f9998f5a965d8eaedb (diff) | |
Fixed #12405 -- Added LOGOUT_REDIRECT_URL setting.
After a user logs out via auth.views.logout(), they're redirected
to LOGOUT_REDIRECT_URL if no `next_page` argument is provided.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_views.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index f3593d46c5..76a1abf6ed 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -878,6 +878,18 @@ class LogoutTest(AuthViewsTestCase): self.client.get('/logout/') self.assertEqual(self.client.session[LANGUAGE_SESSION_KEY], 'pl') + @override_settings(LOGOUT_REDIRECT_URL='/custom/') + def test_logout_redirect_url_setting(self): + self.login() + response = self.client.get('/logout/') + self.assertRedirects(response, '/custom/', fetch_redirect_response=False) + + @override_settings(LOGOUT_REDIRECT_URL='logout') + def test_logout_redirect_url_named_setting(self): + self.login() + response = self.client.get('/logout/') + self.assertRedirects(response, '/logout/', fetch_redirect_response=False) + # Redirect in test_user_change_password will fail if session auth hash # isn't updated after password change (#21649) |
