Skip to content

Commit

Permalink
Revert "Add test for redirects without trailing slash being redirecte…
Browse files Browse the repository at this point in the history
…d in one go"

This reverts commit e58b0e0.
  • Loading branch information
gasman committed Apr 3, 2024
1 parent a9b6034 commit 6f2f6d0
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions wagtail/contrib/redirects/tests/test_redirects.py
Expand Up @@ -200,21 +200,6 @@ def test_temporary_redirect(self):
response, "/redirectto", status_code=302, fetch_redirect_response=False
)

def test_redirect_without_trailing_slash(self):
# Create a redirect
redirect = models.Redirect(old_path="/redirectme", redirect_link="/redirectto")
redirect.save()

response = self.client.get("/redirectme")
# Request should be picked up by RedirectMiddleware, not CommonMiddleware
# (which would redirect to /redirectme/ instead).
# Before Django 4.2, CommonMiddleware performed the 'add trailing slash' test
# during the initial request processing, which took precedence over RedirectMiddleware
# and caused a double redirect (/redirectme -> /redirectme/ -> /redirectto).
self.assertRedirects(
response, "/redirectto", status_code=301, fetch_redirect_response=False
)

def test_redirect_stripping_query_string(self):
# Create a redirect which includes a query string
redirect_with_query_string = models.Redirect(
Expand Down

0 comments on commit 6f2f6d0

Please sign in to comment.