summaryrefslogtreecommitdiff
path: root/tests/handlers
AgeCommit message (Collapse)Author
2026-03-06Fixed #36940 -- Fixed script name edge case in ASGIRequest.path_info.khadyottakale
Paths that happened to begin with the script name were inappropriately stripped, instead of checking that script name preceded a slash.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2024-08-28Refs #33735 -- Adjusted warning stacklevel in ↵Simon Charette
StreamingHttpResponse.__iter__()/__aiter__().
2024-04-05Fixed #35354 -- Simplified ASGIRequest path handling.Carlton Gibson
Following the ASGI HTTP Connection Scope docs[0], the provided `path` is already the correct value that Django requires. In combination with `root_path`, from which `script_name` is derived, the `path_info` variable is set. It's then redundant to re-calculate `path` from `script_name` and `path_info`. See also, a clarifying discussion on the ASGIref repo[1]. [0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-scope [1]: https://github.com/django/asgiref/issues/424
2024-04-05Refs #35169 -- Added test for ASGIRequest root_path handling.Carlton Gibson
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-04-12Fixed #34394 -- Added FORCE_SCRIPT_NAME handling to ASGIRequest.sarahboyce
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-02-17Fixed #34342, Refs #33735 -- Fixed test client handling of async streaming ↵Alexandre Spaeth
responses. Bug in 0bd2c0c9015b53c41394a1c0989afbfd94dc2830. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2023-02-17Refs #34342 -- Added tests for handling sync streaming responses by test client.Alexandre Spaeth
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2023-02-14Fixed CVE-2023-24580 -- Prevented DoS with too many uploaded files.Markus Holtermann
Thanks to Jakob Ackermann for the report.
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2022-12-05Improved test coverage for django.db.transaction.Pablo
2022-02-15Refs #31407 -- Handled potential exception in test cleanup.Carlton Gibson
The test view may not be called when running the tests with --parallel=2 or greater. Catch the AttributeError for this case.
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
2021-02-19Refs CVE-2021-23336 -- Updated tests and release notes for affected versions.Nick Pope
2021-02-10Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak
2020-09-09Fixed #31962 -- Made SessionMiddleware raise SessionInterrupted when session ↵Hasan Ramezani
destroyed while request is processing.
2020-04-20Capitalized Unicode in docs, strings, and comments.Jon Dufresne
2020-04-09Fixed #31407 -- Fixed unawaited coroutine warning for Python 3.8+.Carlton Gibson
Co-authored-by: Mark Korput <dr.theman@gmail.com>
2020-04-07Fixed #31407 -- Adjusted test to avoid coroutine never awaited warning.Mark
2020-03-18Fixed #31224 -- Added support for asynchronous views and middleware.Andrew Godwin
This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client.
2019-01-03Fixed #30070, CVE-2019-3498 -- Fixed content spoofing possiblity in the ↵Tom Hacohen
default 404 page. Co-Authored-By: Tim Graham <timograham@gmail.com>
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
2018-11-27Made reused RequestFactory instances class attributes.Simon Charette
2018-11-23Fixed #29966 -- Added tests for BaseHandler's "The view didn't return an ↵Hasan Ramezani
HttpResponse object" error.
2018-05-27Removed obsolete BaseHandler attributes.Daniel Hepper
Unused since d334f46b7a080fd3eb720141c19b37b10704a352.
2017-09-25Fixed #27857 -- Dropped support for Python 3.4.Tim Graham
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-03-17Replaced type-specific assertions with assertEqual().Tim Graham
Python docs say, "it's usually not necessary to invoke these methods directly."
2017-02-13Fixed #27820 -- Fixed RequestDataTooBig/TooManyFieldsSent crash.amalia
2017-02-04Fixed running TransactionsPerRequestTests in isolation.Jon Dufresne
Caused by `contrib/auth/backends.py` changes in cb7bbf97a74fa7800865e3615f196ad65dc4f281.
2017-01-20Refs #23919 -- Removed unneeded force_str callsClaude Paroz
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
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-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
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-06-24Refs #24829 -- Made TemplateResponse.content available sooner in exception ↵Claude Paroz
context Thanks Tim Graham for the initial patch.
2016-05-17Fixed #26601 -- Improved middleware per DEP 0005.Florian Apolloner
Thanks Tim Graham for polishing the patch, updating the tests, and writing documentation. Thanks Carl Meyer for shepherding the DEP.
2016-04-29Fixed #26546 -- Allowed HTTPStatus enum values for HttpResponse.status.David Evans
2016-04-04Fixed #26452 -- Loaded middleware on server start rather than on first request.David Evans
2015-11-21Fixed #25780 -- Removed redundant status code assertions from testsAlex Morozov
2015-10-23Fixed #17133 -- Properly handled successive slashes in incoming requestsClaude Paroz
Thanks gjanee@ucop.edu for the report and Tim Graham for the review.
2015-06-17Fixed #24829 -- Allowed use of TemplateResponse in view error handlers.ana-balica
2015-05-20Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette
2015-03-08Fixed #23173 -- Fixed incorrect stripping of SCRIPT_URLBas Peschier