Skip to content

Commit 96c79be

Browse files
Kashemir001sarahboyce
authored andcommitted
Fixed #36332 -- Corrected HttpRequest.get_full_path() and HttpRequest.get_full_path_info() examples.
1 parent f920937 commit 96c79be

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/ref/request-response.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,14 @@ Methods
351351

352352
Returns the ``path``, plus an appended query string, if applicable.
353353

354-
Example: ``"/music/bands/the_beatles/?print=true"``
354+
Example: ``"/minfo/music/bands/the_beatles/?print=true"``
355355

356356
.. method:: HttpRequest.get_full_path_info()
357357

358358
Like :meth:`get_full_path`, but uses :attr:`path_info` instead of
359359
:attr:`path`.
360360

361-
Example: ``"/minfo/music/bands/the_beatles/?print=true"``
361+
Example: ``"/music/bands/the_beatles/?print=true"``
362362

363363
.. method:: HttpRequest.build_absolute_uri(location=None)
364364

tests/requests_tests/tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ def test_httprequest(self):
5353

5454
def test_httprequest_full_path(self):
5555
request = HttpRequest()
56-
request.path = "/;some/?awful/=path/foo:bar/"
57-
request.path_info = "/prefix" + request.path
56+
request.path_info = "/;some/?awful/=path/foo:bar/"
57+
request.path = "/prefix" + request.path_info
5858
request.META["QUERY_STRING"] = ";some=query&+query=string"
5959
expected = "/%3Bsome/%3Fawful/%3Dpath/foo:bar/?;some=query&+query=string"
60-
self.assertEqual(request.get_full_path(), expected)
61-
self.assertEqual(request.get_full_path_info(), "/prefix" + expected)
60+
self.assertEqual(request.get_full_path_info(), expected)
61+
self.assertEqual(request.get_full_path(), "/prefix" + expected)
6262

6363
def test_httprequest_full_path_with_query_string_and_fragment(self):
6464
request = HttpRequest()
65-
request.path = "/foo#bar"
66-
request.path_info = "/prefix" + request.path
65+
request.path_info = "/foo#bar"
66+
request.path = "/prefix" + request.path_info
6767
request.META["QUERY_STRING"] = "baz#quux"
68-
self.assertEqual(request.get_full_path(), "/foo%23bar?baz#quux")
69-
self.assertEqual(request.get_full_path_info(), "/prefix/foo%23bar?baz#quux")
68+
self.assertEqual(request.get_full_path_info(), "/foo%23bar?baz#quux")
69+
self.assertEqual(request.get_full_path(), "/prefix/foo%23bar?baz#quux")
7070

7171
def test_httprequest_repr(self):
7272
request = HttpRequest()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy