summaryrefslogtreecommitdiff
path: root/tests/async
AgeCommit message (Collapse)Author
2026-09-27Fixed #37066 -- Wrapped async iteration sites in (maybe_)aclosing.Thomas Grainger
Replaced bare `async for` over a not-locally-defined async iterable with `async with (maybe_)aclosing(aiter(...)) as it: async for item in it:` at every consumption site, so the iterator's aclose() runs deterministically when the consumer exits — instead of being deferred to asyncio's asyncgen finalizer hook. Added django.utils.asyncio.maybe_aclosing as a small wrapper that uses contextlib.aclosing when the iterator has aclose() and contextlib.nullcontext otherwise (for caller-supplied iterators that may only implement __aiter__ and __anext__). Sites: - contrib/auth/backends.py:_aget_permissions (aclosing) - core/paginator.py:AsyncPage.__aiter__ (maybe_aclosing) - core/paginator.py:AsyncPage.aget_object_list (maybe_aclosing) - db/models/query.py:QuerySet.aiterator (aclosing, hoisted across both prefetch and no-prefetch branches) - http/response.py:StreamingHttpResponse.streaming_content awrapper (maybe_aclosing) - http/response.py:StreamingHttpResponse.__iter__ to_list (maybe_aclosing) - http/response.py:StreamingHttpResponse.__aiter__ (aclosing) - shortcuts.py:aget_list_or_404 (aclosing) - test/client.py:aclosing_iterator_wrapper (maybe_aclosing) - utils/text.py:acompress_sequence (maybe_aclosing)
2026-09-03Fixed #37293 -- Renamed RemovedInDjango71Warning to RemovedInDjango2029Warning.Carlton Gibson
Per DEP 20, Django's version numbers are calendar-based from 2028, so deprecation warning classes are now named after the calendar version that removes the feature they mark, and the deprecation timeline is headed by the same calendar version. Updated references to RemovedInDjango71Warning to use the new warning, and adjusted references to "Django 7.1" to "Django 2029".
2026-08-05Fixed #37205 -- Asserted exact HttpResponse types in tests.Jonathan Biemond
assertIsInstance passes when the expected is a superclass of the returned object. Thanks James Bligh for the review!
2026-06-18Fixed #37143 -- Added missing chunk_size=None check to QuerySet.aiterator().zhengkangyang
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2026-01-31Refs #34118 -- Removed asgiref coroutine detection shims.Jacob Walls
As Python 3.12 is now the floor, we can drop the shims and use the `inspect` module.
2025-09-17Refs #35530 -- Removed request.user or auser() fallback in auth.login and ↵Jacob Walls
auth.alogin. Per deprecation timeline.
2025-08-22Refs #35530 -- Corrected deprecation message in auth.alogin().Mariusz Felisiak
Follow up to ceecd518b19044181a3598c55ebed7c2545963cc.
2025-08-20Fixed #36561 -- Used request.auser() in ↵Xinyi Rong
contrib.auth.aupdate_session_auth_hash().
2024-11-28Fixed #35530 -- Deprecated request.user fallback in auth.login and auth.alogin.Jaap Roes
2024-10-07Fixed #35303 -- Implemented async auth backends and utils.Jon Janzen
2024-01-15Fixed #28344 -- Allowed customizing queryset in ↵Aivars Kalvans
Model.refresh_from_db()/arefresh_from_db(). The from_queryset parameter can be used to: - use a custom Manager - lock the row until the end of transaction - select additional related objects
2023-07-31Fixed #34331 -- Added QuerySet.aiterator() support for prefetch_related().John Parton
2023-07-24Fixed #34714 -- Added aget_object_or_404()/aget_list_or_404() shortcuts.Olivier Tabone
2023-06-27Fixed #34391 -- Added async-compatible interface to auth functions and ↵Jon Janzen
related methods test clients.
2023-02-14Fixed #34280 -- Allowed specifying different field values for create ↵tschilling
operation in QuerySet.update_or_create().
2022-12-20Refs #34118 -- Adopted asgiref coroutine detection shims.Carlton Gibson
Thanks to Mariusz Felisiak for review.
2022-11-09Fixed #34135 -- Added async-compatible interface to related managers.Jon Janzen
2022-11-08Fixed #34139 -- Fixed acreate(), aget_or_create(), and aupdate_or_create() ↵Jon Janzen
methods for related managers. Bug in 58b27e0dbb3d31ca1438790870b2b51ecdb10500.
2022-11-03Refs #33646 -- Moved tests of QuerySet async interface into async tests.Bhuvnesh
2022-11-02Fixed #34112 -- Added async-compatible interface to Model methods.DevilsAutumn
Thanks Adam Johnson for the review.
2022-09-29Fixed #34062 -- Updated View.http_method_not_allowed() to support async.Antoine Lorence
As with the options() methods, wrap the response in a coroutine if the view is async. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-04-14Removed stale Windows asyncio test skips.Carlton Gibson
Underlying issue was fixed in Python 3.8.1, now many versions ago. https://bugs.python.org/issue38563
2022-04-07Fixed #33611 -- Allowed View subclasses to define async method handlers.Carlton Gibson
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-03-05Refs #31224 -- Added autoconversion of test async methods.Andrew Godwin
2020-02-11Fixed #31253 -- Fixed data loss possibility when using caching from async code.Jon Dufresne
Case missed in a415ce70bef6d91036b00dd2c8544aed7aeeaaed.
2019-12-03Fixed #31056 -- Allowed disabling async-unsafe check with an environment ↵Andrew Godwin
variable.
2019-10-24Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.Carlton Gibson
Refs https://bugs.python.org/issue38563.
2019-06-20Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.