          csrf_token = get_token(req)
          req.COOKIES[settings.CSRF_COOKIE_NAME] = csrf_token
          req.POST = {"csrfmiddlewaretoken": csrf_token}
          req.session = self.client.session
          response = logout_then_login(req)
          self.confirm_logged_out()
          self.assertRedirects(response, "/login/", fetch_redirect_response=False)
 
</s> remove         self.assertRedirects(response, "/logout/", fetch_redirect_response=False)
 </s> add         self.assertContains(response, "Logged out")
        self.confirm_logged_out() </s> remove         next_page = self.get_default_redirect_url()

        if (
            self.redirect_field_name in self.request.POST
            or self.redirect_field_name in self.request.GET
        ):
            next_page = self.get_redirect_url()
            if next_page == "":
                if settings.LOGOUT_REDIRECT_URL:
                    next_page = resolve_url(settings.LOGOUT_REDIRECT_URL)
                else:
                    next_page = self.request.path
        return next_page
 </s> add         return self.get_redirect_url() or self.get_default_redirect_url() </s> remove             return None
 </s> add             return self.request.path
        req.META["SERVER_NAME"] = "testserver"
        req.META["SERVER_PORT"] = 80
          csrf_token = get_token(req)
          req.COOKIES[settings.CSRF_COOKIE_NAME] = csrf_token
          req.POST = {"csrfmiddlewaretoken": csrf_token}
        req.META["SERVER_NAME"] = "testserver"
        req.META["SERVER_PORT"] = 80
          req.session = self.client.session
          response = logout_then_login(req)
          self.confirm_logged_out()
          self.assertRedirects(response, "/login/", fetch_redirect_response=False)
keep keep add keep keep keep keep
 Simplified LogoutView.get_success_url().

This preserves the behavior of redirecting to the logout URL without
query string parameters when an insecure ?next=... parameter is given.

It changes the behavior of a POST to the logout URL, as shown by the
test that is changed. Currently, this results in a GET to the logout
URL. However, such GET requests are deprecated. This change would be
necessary in Django 5.0 anyway. This commit merely anticipates it. 
tests/auth_tests/test_views.py