mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #23395 -- Limited line lengths to 119 characters.
This commit is contained in:
parent
84b0a8d2aa
commit
b1e33ceced
130 changed files with 5259 additions and 1501 deletions
|
@ -88,10 +88,20 @@ class RequestsTests(SimpleTestCase):
|
|||
Refs #20169.
|
||||
"""
|
||||
# With trailing slash
|
||||
request = WSGIRequest({'PATH_INFO': '/somepath/', 'SCRIPT_NAME': '/PREFIX/', 'REQUEST_METHOD': 'get', 'wsgi.input': BytesIO(b'')})
|
||||
request = WSGIRequest({
|
||||
'PATH_INFO': '/somepath/',
|
||||
'SCRIPT_NAME': '/PREFIX/',
|
||||
'REQUEST_METHOD': 'get',
|
||||
'wsgi.input': BytesIO(b''),
|
||||
})
|
||||
self.assertEqual(request.path, '/PREFIX/somepath/')
|
||||
# Without trailing slash
|
||||
request = WSGIRequest({'PATH_INFO': '/somepath/', 'SCRIPT_NAME': '/PREFIX', 'REQUEST_METHOD': 'get', 'wsgi.input': BytesIO(b'')})
|
||||
request = WSGIRequest({
|
||||
'PATH_INFO': '/somepath/',
|
||||
'SCRIPT_NAME': '/PREFIX',
|
||||
'REQUEST_METHOD': 'get',
|
||||
'wsgi.input': BytesIO(b''),
|
||||
})
|
||||
self.assertEqual(request.path, '/PREFIX/somepath/')
|
||||
|
||||
def test_wsgirequest_with_force_script_name(self):
|
||||
|
@ -101,7 +111,12 @@ class RequestsTests(SimpleTestCase):
|
|||
Refs #20169.
|
||||
"""
|
||||
with override_settings(FORCE_SCRIPT_NAME='/FORCED_PREFIX/'):
|
||||
request = WSGIRequest({'PATH_INFO': '/somepath/', 'SCRIPT_NAME': '/PREFIX/', 'REQUEST_METHOD': 'get', 'wsgi.input': BytesIO(b'')})
|
||||
request = WSGIRequest({
|
||||
'PATH_INFO': '/somepath/',
|
||||
'SCRIPT_NAME': '/PREFIX/',
|
||||
'REQUEST_METHOD': 'get',
|
||||
'wsgi.input': BytesIO(b''),
|
||||
})
|
||||
self.assertEqual(request.path, '/FORCED_PREFIX/somepath/')
|
||||
|
||||
def test_wsgirequest_path_with_force_script_name_trailing_slash(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue