      @override_settings(LOGOUT_REDIRECT_URL="logout")
      def test_logout_redirect_url_named_setting(self):
          self.login()
          response = self.client.post("/logout/")
          self.assertRedirects(response, "/logout/", fetch_redirect_response=False)
  
  
  def get_perm(Model, perm):
      ct = ContentType.objects.get_for_model(Model)
      return Permission.objects.get(content_type=ct, codename=perm)
 
</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
        self.assertContains(response, "Logged out")
        self.confirm_logged_out()
      @override_settings(LOGOUT_REDIRECT_URL="logout")
      def test_logout_redirect_url_named_setting(self):
          self.login()
          response = self.client.post("/logout/")
        self.assertContains(response, "Logged out")
        self.confirm_logged_out()
  
  
  def get_perm(Model, perm):
      ct = ContentType.objects.get_for_model(Model)
      return Permission.objects.get(content_type=ct, codename=perm)
keep keep keep keep replace keep 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