summaryrefslogtreecommitdiff
path: root/tests/requests/tests.py
AgeCommit message (Collapse)Author
2023-01-07Renamed 'requests' test package.Tim Graham
This avoids a collision when third-party database backends depend on the Requests HTTP library.
2023-01-05Refs #33865 -- Improved implementation of FakePayload.Nick Pope
FakePayload is a wrapper around io.BytesIO and is expected to masquerade as though it is a file-like object. For that reason it makes sense that it should inherit the correct signatures from io.BytesIO methods. Crucially an implementation of .readline() is added which will be necessary for this to behave more like the expected file-like objects as LimitedStream will be changed to defer to the wrapped stream object rather than rolling its own implementation for improved performance. It should be safe to adjust these signatures because FakePayload is only used internally within test client helpers, is undocumented, and thus private.
2023-01-05Refs #33865 -- Corrected signature of ExplodingBytesIO.read().Nick Pope
These subclasses of io.BytesIO should inherit the correct signature.
2023-01-05Refs #33865 -- Made RequestsTests.test_set_encoding_clears_GET use FakePayload.Nick Pope
The input stream, wsgi.input, must be a file-like object. The existing implementation of LimitedStream was lax and allowed an empty string to be passed incorrectly. See https://wsgi.readthedocs.io/en/latest/definitions.html#envvar-wsgi.input
2022-11-14Fixed #34074 -- Added headers argument to RequestFactory and Client classes.David Wobrock
2022-11-10Updated documentation and comments for RFC updates.Nick Pope
- Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
2022-09-14Fixed #29186 -- Fixed pickling HttpRequest and subclasses.Anvesh Mishra
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
2021-04-30Fixed #32698 -- Moved HttpRequest.get_raw_uri() to ↵Hasan Ramezani
ExceptionReporter._get_raw_insecure_uri().
2019-12-05Fixed #31010 -- Allowed subdomains of localhost in the Host header by ↵Gordon Pendleton
default when DEBUG=True.
2019-08-23Fixed typos in test names and a comment.Min ho Kim
2019-05-09Fixed #30310 -- Added support for looking up HttpHeaders.headers using ↵Troon
underscores.
2019-03-02Refs #30227 -- Added helpful message for non-ASCII Content-Type in mulitpart ↵Tim Graham
request.
2019-03-02Fixed #30227 -- Fixed crash on request without boundary in Content-Type.Tim Graham
2019-01-28Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-16Fixed #20147 -- Added HttpRequest.headers.Santiago Basulto
2019-01-02Used 4 space hanging indent for dictionaries.Tim Graham
Thanks Mariusz Felisiak for auditing.
2018-09-26Refs #29784 -- Switched to https:// links where available.Jon Dufresne
2018-01-10Added more tests for HttpRequest.build_absolute_uri().George-Cristian Bîrzan
2018-01-10Updated HttpRequest.build_absolute_uri() tests to use subTest().Tim Graham
2018-01-08Moved HttpResponse.set_cookie() tests to an appropriate location.Tim Graham
2018-01-02Fixed #28965 -- Updated Set-Cookie's Expires date format to follow RFC 7231.Alexey
2017-11-07Fixed #28720 -- Added HttpRequest.get_full_path_info().Jonas Haag
2017-11-06Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-05-25Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's tests.Rajesh Veeranki
2017-01-26Refs #23919 -- Replaced usage of django.utils.http utilities with Python ↵Claude Paroz
equivalents Thanks Tim Graham for the review.
2017-01-20Refs #23919 -- Removed str_prefix usageClaude Paroz
2017-01-20Refs #23919 -- Removed unneeded force_str callsClaude Paroz
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-12-07Refs #17235 -- Made MultiPartParser leave request.POST immutable.Vinay Karanam
2016-11-29Fixed #27181 -- Allowed contrib.sites to match domains with trailing ".".Anton Samarchyan
2016-11-17Fixed #27156 -- Made changing HttpRequest.encoding clear GET.PREMANAND
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-11-01Fixed CVE-2016-9014 -- Validated Host header when DEBUG=True.Tim Graham
This is a security fix.
2016-08-30Fixed #27113 -- Tested that setting HttpRequest.encoding clears POST.PremAnand Lakshmanan
2016-08-23Fixed #26971 -- Prevented crash with non-UTF-8 incoming PATH_INFOClaude Paroz
Thanks Tim Graham and Loïc Bistuer for the reviews.
2016-08-11Fixed #27046 -- Supported IPv6-formatted IPv4 addresses in host validation.Tim Graham
Thanks LaMont Jones for the report and patch.
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-03-15Fixed #26158 -- Rewrote http.parse_cookie() to better match browsers.Collin Anderson
2016-02-15Fixed #26126 -- Fixed transient failure of test_max_age_expirationBerker Peksag
2016-02-10Fixed #26014 -- Added WSGIRequest content_type and content_params attributes.Curtis Maloney
Parsed the CONTENT_TYPE header once and recorded it on the request.
2016-01-29Refs #26022 -- Used context manager version of assertRaisesMessage in tests.Hasan
2016-01-29Refs #26022 -- Used context manager version of assertRaises in tests.Hasan
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-11-18Fixed #25644 -- Fixed reset cookie expiry date bug.Raphael Merx
Setting a cookie with the same name as a previously deleted cookie would set its expiry date to 'Thu, 01-Jan-1970 00:00:00 GMT'.