Loading django/test/client.py +1 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,7 @@ class Client(RequestFactory): else: request.session = engine.SessionStore() logout(request) self.cookies = SimpleCookie() def _handle_redirects(self, response, **extra): "Follows any redirects by requesting responses from the server using GET." Loading docs/releases/1.6.1.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,5 @@ Bug fixes multiple times (#21488, #17181). * Fixed a regression that unnecessarily triggered settings configuration when importing ``get_wsgi_application`` (#21486). * Fixed test client ``logout()`` method when using the cookie-based session backend (#21448). tests/test_client/tests.py +4 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,10 @@ class ClientTest(TestCase): response = self.client.get('/test_client/login_protected_view/') self.assertRedirects(response, 'http://testserver/accounts/login/?next=/test_client/login_protected_view/') @override_settings(SESSION_ENGINE="django.contrib.sessions.backends.signed_cookies") def test_logout_cookie_sessions(self): self.test_logout() def test_view_with_permissions(self): "Request a page that is protected with @permission_required" Loading Loading
django/test/client.py +1 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,7 @@ class Client(RequestFactory): else: request.session = engine.SessionStore() logout(request) self.cookies = SimpleCookie() def _handle_redirects(self, response, **extra): "Follows any redirects by requesting responses from the server using GET." Loading
docs/releases/1.6.1.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,5 @@ Bug fixes multiple times (#21488, #17181). * Fixed a regression that unnecessarily triggered settings configuration when importing ``get_wsgi_application`` (#21486). * Fixed test client ``logout()`` method when using the cookie-based session backend (#21448).
tests/test_client/tests.py +4 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,10 @@ class ClientTest(TestCase): response = self.client.get('/test_client/login_protected_view/') self.assertRedirects(response, 'http://testserver/accounts/login/?next=/test_client/login_protected_view/') @override_settings(SESSION_ENGINE="django.contrib.sessions.backends.signed_cookies") def test_logout_cookie_sessions(self): self.test_logout() def test_view_with_permissions(self): "Request a page that is protected with @permission_required" Loading