mirror of
https://github.com/django/django.git
synced 2025-10-17 22:07:29 +00:00
Fixed #26812 -- Fixed APPEND_SLASH on a URL including querystring with a trailing slash.
This commit is contained in:
parent
29563cfb80
commit
f46a838efc
2 changed files with 13 additions and 1 deletions
|
@ -83,6 +83,18 @@ class CommonMiddlewareTest(SimpleTestCase):
|
|||
r = CommonMiddleware().process_response(request, response)
|
||||
self.assertEqual(r.url, '/slash/?test=1')
|
||||
|
||||
@override_settings(APPEND_SLASH=True)
|
||||
def test_append_slash_redirect_querystring_have_slash(self):
|
||||
"""
|
||||
APPEND_SLASH should append slash to path when redirecting a request
|
||||
with a querystring ending with slash.
|
||||
"""
|
||||
request = self.rf.get('/slash?test=slash/')
|
||||
response = HttpResponseNotFound()
|
||||
r = CommonMiddleware().process_response(request, response)
|
||||
self.assertIsInstance(r, HttpResponsePermanentRedirect)
|
||||
self.assertEqual(r.url, '/slash/?test=slash/')
|
||||
|
||||
@override_settings(APPEND_SLASH=True, DEBUG=True)
|
||||
def test_append_slash_no_redirect_on_POST_in_DEBUG(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue