summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
4 daysFixed #37317 -- Deprecated passing table names to createcachetable.Dmitri Leiko
Thank you to Mike Edmunds for the review.
4 daysFixed #33752 -- Added support for exception groups to technical 500 debug pages.krystof
Thank you to James Bligh and Tim Schilling for the reviews.
4 daysFixed #37471 -- Made models.E050 detect generic relations with ↵Akshat
database-level on_delete.
4 daysBumped minimum Playwright version to 1.65.0.Varun Kasyap
6 daysFixed #36998 -- Rejected firstof tags without arguments before "as".Awath Javar Abdat
Co-authored-by: David Smith <39445562+smithdc1@users.noreply.github.com>
6 daysFixed #37081 -- Allowed dots in fixture directory paths in loaddata.Alisson Silveira
9 daysFixed #30306 -- Added input_type to Textarea widget.Hossein
Updated widget templates to render the `hidden` attribute if the input_type is set to "hidden".
9 daysFixed #36642 -- Fixed capitalization of locale suggestions in makemessages.kihuni
9 daysRefs #36642 -- Added makemessages test for en_001 locale.kihuni
10 daysFixed #37330 -- Fixed QuerySet.values() crash with an annotation transform.Kunal Kumar
Applying a transform to an annotation alias in values() crashed with AttributeError when the annotation's output_field was not attached to a model: Book.objects.annotate(published=TruncMonth("pubdate")).values("published__year") AttributeError: 'DateField' object has no attribute 'model' Thanks David Smith for offering a useful test case during triage. Co-authored-by: ontowhee <82607723+ontowhee@users.noreply.github.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
10 daysRefs #37330 -- Added further annotations tests for QuerySet.values().Kunal Kumar
10 daysFixed #36022 -- Renamed django-admin to django.Ryan Hiebert
This change implements DEP 16: to rename the django-admin command to django. django-admin is kept as an alias. Docs references to the "django-admin" command are updated to "django" or “The django command”. Renamed the `django-admin` Sphinx directive to `cmd`, and the `django-admin-option` directive to `cli-option`. Thanks Johannes Maron, Mike Edmunds, and Jacob Walls for reviews.
10 daysFixed #20551 -- Renamed duplicate "initial" fixtures in gis_tests.Dmitri Leiko
The distapp, geoapp, geogapp, and relatedapp test apps each shipped a fixture named "initial". Since loaddata loads every match found in different fixture directories, each test case using fixtures=["initial"] loaded all four fixtures when the full gis_tests suite ran.
12 daysFixed #37469 -- Made psycopg adapter UTF8Dumper handle None.François Freitag
The adapter for psycopg2 serialized None to SQL NULL [1]. This behavior should be maintained for psycopg3, as psql_escape returns None when no value remain after escaping and stripping. Thanks to Camille Daniel for the initial bug report. [1] https://github.com/psycopg/psycopg2/blob/7d0375492ec3707b82b89f632c9654b400466d86/psycopg/adapter_asis.c#L42-L45
12 daysFixed CVE-2026-114582 -- Blocked file and network access when setting SRS on ↵Jacob Walls
GDAL 3.9+. Anything instantating `SpatialReference`, including vector and raster `transform()` methods and `srs`/`srid` setters, was subject to request forgery from untrusted strings, since GDAL resolves file and network references by default. On GDAL 3.9+, Django now uses `OSRSetFromUserInputEx()` to block file and network access in this path. On lower GDAL versions, users should compare inputs to an allow list or use integers when setting or transforming a spatial reference system (SRS). A new `gis.W001` check warns if a lower GDAL version is installed. Thanks Adraca for the report and Sarah Boyce and David Smith for reviews.
12 daysFixed CVE-2026-113733 -- Fixed password hash disclosure to "view only" admin ↵Natalia
users with custom user models. Since Django 6.0, the admin obfuscated the password hash only when the field's model was exactly AUTH_USER_MODEL. Other user models, and user models inheriting the password field from a concrete parent model, failed that check, so the full hash was displayed to users with only the view permission. Thanks to Aaron chen for the report, and Jake Howard for the review.
12 daysFixed CVE-2026-113593 -- Differentiated empty and missing headers in ↵Andrew James Gonzalez
response cache. When learning the cache key for a response, a missing header must be cached differently to an empty one, as per RFC 9111. Thanks to Andrew Gonzalez for the report. Co-authored-by: Jake Howard <git@theorangeone.net>
12 daysFixed CVE-2026-111362 -- Blocked external CRS values in GeoJSON geometries.Jacob Walls
Even though the "crs" member was removed from the GeoJSON spec in 2016, GDAL's GeoJSON parser still supports this value and can resolve file and network locations. An attacker could submit a malicious CRS that would make a network request as the Django process user, or read a file, or both. Django now rejects these values when constructing geometries and in forms and lookups. (Utilities for processing trusted data such as `DataSource` and `LayerMapping` continue to forward these values to GDAL without validation.) Any `crs` definition with `"type": "link"` or `"type": "url"` is now rejected outright. Any definition with `"type": "name"` has its `properties.name` compared to an allow list of known authorities, or a regex for an OGC CRS URN, or well-known shorthands, e.g. "CRS84". Thanks to Submersion Security Research Team for the report, and David Smith and Sarah Boyce for the reviews.
12 daysFixed CVE-2026-111211 -- Escaped log messages in ↵David Smith
BaseGeometryWidget.deserialize(). Suitably crafted values submitted to a GeometryField may have allowed log injection, potentially corrupting log files, obscuring other attacks, misleading log post-processing tools, or forging log entries. To mitigate this, invalid values logged on deserialization errors are now escaped using "unicode_escape" encoding, and trimmed to 4096 characters to avoid flooding logs with large inputs. Thanks to Aaron chen for the report, and to Jacob Walls, Jake Howard, and Shai Berger for the reviews. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
12 daysFixed CVE-2026-108147 -- Bounded memory use of base64 file uploads in ↵Natalia
MultiPartParser. The mitigation for CVE-2026-33033 aligned base64 data to a multiple of 4 by reading whole chunks. As the chunk size is itself a multiple of 4, those reads never restored the alignment, so a misaligned upload was read and decoded in full before reaching upload handlers. Trailing undecoded bytes are now carried over to the next chunk, so no extra reads are needed and memory use stays bounded by the chunk size. Thanks to Ignacy Kujawa for the report, and Jake Howard for the review.
13 daysFixed #37436 -- Avoided overwriting when FETCH_PEERS fetches deferred fields.Namraa Patel
If a deferred field has been plucked via `refresh_from_db(fields=...)` or modified by assigning an attribute, it shouldn't be overwritten when attribute access on a peer triggers a `fetch_many()`. The peer fetching should also tolerate deleted instances. Co-authored-by: Vishy <vishyzero@gmail.com>
14 daysFixed #37467 -- Fixed deletion of cookies with __Http- and __Host-Http- ↵himanshu
prefixes.
2026-10-29Fixed #37463 -- Fixed attrs mutation in legend_tag().Jacob Walls
Regression in 0eec2a163a4b2ea4e82c53ae1d7b71bf43ac911d.
2026-10-28Fixed #37089 -- Made ignore_warnings() match substrings by default.HelmiDev03
Thank you Mike Edmunds for the review.
2026-10-28Refs #37089 -- Added test coverage for ignore_warnings().HelmiDev03
2026-10-28Refs #35899 -- Added allow_multiline_tags transitional template option to ↵=?UTF-8?q?Anders=20Hovm=C3=B6ller?=
disable multiline template tags. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2026-10-28Fixed #35899 -- Allowed multiline template tags.=?UTF-8?q?Anders=20Hovm=C3=B6ller?=
Co-authored-by: tim-mccurrach <34194722+tim-mccurrach@users.noreply.github.com>
2026-10-27Fixed #37432 -- Made select_for_update() raise after combined queries.Alex Henman
2026-10-27Fixed #37438 -- Fixed join promotion for XOR conditions.Pravin Kamble
JoinPromoter didn't handle XOR conditions. Because of this, a negated XOR could use an INNER JOIN and remove rows that should be returned. Thanks Simon Charette and Sarah Boyce for review.
2026-10-26Fixed #37232 -- Added support for the HTTP QUERY method.Michiel W. Beijen
QUERY (RFC 10008) is a safe, idempotent method that carries the query in the request content rather than in the URI's query component. Treat it as safe throughout: exempt it from CSRF protection, evaluate request preconditions as for GET, accept it in require_safe(), and dispatch it from View. Query content is available as HttpRequest.body and is not parsed into HttpRequest.POST. Caching is left for a follow-up. Per RFC 10008 Section 2.7 the cache key for a QUERY request must incorporate the request content, which the cache middleware and cache_page() don't do, so they continue to ignore QUERY. Thanks Ben Atkinson, Jonathan Biemond, and Jacob Walls for reviews.
2026-10-26Fixed #37450 -- Fixed parsing of comment and verbatim tags without spaces.Yarchik
Regression in 1a9fba7a6c2a0acead19bbb45c25ceb0fdcca7c8.
2026-10-26Fixed #37427 -- Kept generic relation queryset routing lazy.Лев Злобин
Generic relation managers eagerly bound querysets to a read database, causing implicit subqueries to fail when the outer query used another connection. Passed the related instance as a routing hint while preserving explicit database choices, and added a regression test for the reported case. Thank you to Simon Charette for the review.
2026-10-23Updated asgiref dependency.Carlton Gibson
2026-10-23Fixed #30949 -- Deprecated django.utils.functional.cached_property.Jacob Rief
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2026-10-23Refs #30949 -- Replaced django.utils.functional.cached_property with ↵Jacob Rief
functools.cached_property. Since Python 3.12, `functools.cached_property` no longer takes a lock (https://github.com/python/cpython/issues/87634), which was the main objection to using it instead of Django's own implementation. `Prefetch(to_attr=...)` and the admindocs model detail page now accept `functools.cached_property` as well as Django's own `cached_property`. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2026-10-23Fixed test_asgeojson() on MySQL 9.5.Jacob Walls
MySQL 9.5 added support for the "crs" attribute in GeoJSON: https://dev.mysql.com/doc/relnotes/mysql/9.7/en/news-9-5-0.html#:~:text=ST_AsGeoJSON%20function
2026-10-22Fixed #37395 -- Emitted 'none' for CSP directives left empty by an unused nonce.Sanskar Kharya
Before, if a directive's only source was a nonce, and that nonce was not rendered, the directive was omitted, when in reality we should consider the set of scripts matching the nonce to be empty, and instead fail closed. Thanks Rob Hudson for the implementation idea and review.
2026-10-22Fixed #37401 -- Aligned safe_makedirs() with os.makedirs() semantics.Natalia
Python 3.15 added the `parent_mode` argument to `os.makedirs()`, the upstream fix for the issue that led Django to vendor its own `makedirs()` in the fix for CVE-2026-25674. The vendored copy differed from CPython only by an extra `chmod()` call that ignored the process umask. Dropping that call allows using `os.makedirs()` directly on Python 3.15+, and removing the vendored copy once Python 3.14 support ends. As a trade-off, directories created by `FileSystemStorage` when `FILE_UPLOAD_DIRECTORY_PERMISSIONS` (or `directory_permissions_mode`) is set, and by `FileBasedCache`, now have the requested permissions mode combined with the process umask, and the set-group-ID bit and other bits beyond the last 9 are no longer guaranteed to be set. `FILE_UPLOAD_PERMISSIONS` is unaffected. Thanks Shai Berger for the proposal and review, Ken Whitesell and Carlton Gibson for the discussion, and Tim Schilling, Jacob Walls, and Lily for reviews. Refs #36664.
2026-10-22Fixed #37433 -- Escaped database error messages logged by Q.check().Natalia
Database error messages can include the values being validated, which may originate from user input. Logging them through `log_message()` escapes their content and keeps large values trimmed, consistent with other logging call sites. Thanks Jacob Walls for reviews.
2026-10-22Refs #37433 -- Added django.utils.text.trim_value() helper.Natalia
The debug page and the raster lookup check each trimmed large values to 4096 characters with their own copy of the same code. The shared helper also corrects the suffix, which reported characters as bytes and showed the original length as if it were the amount trimmed. The trimmed value and the suffix are returned separately so callers can escape the value without escaping the suffix. Refs #34746.
2026-10-21Refs #34865 -- Cleared gc.garbage in ↵Jacob Walls
test_release_memory_without_garbage_collection(). gc.collect() doesn't actually clear gc.garbage.
2026-10-21Fixed #37396 -- Added gettext to PATH in Windows CI.HelmiDev03
Chocolatey's gettext bin directory wasn't on PATH for later steps, so tests requiring msgfmt and xgettext were skipped on Windows. Skipped PoFileTests.test_no_write_access on Windows, where chmod() cannot make a directory read-only.
2026-10-21Fixed #37419 -- Included CSP nonces in headers for streaming responses.Sarah Boyce
Thank you Michael Codispoti (codispoti) for the report. Thank you to Jake Howard, Jacob Walls and Rob Hudson for the reviews.
2026-10-21Fixed #37407 -- Prevented UUIDTextMixin from mutating the lookup in-place.Clifford Gama
2026-10-20Fixed #37431 -- Added support for serializing frozendicts in migrations.Aman Kumar Jain
2026-10-20Fixed #36664 -- Doc'd Python 3.15 compatibility.Mariusz Felisiak
2026-10-15Pinned Playwright below 1.64.0 to avoid false WebKit CSP violation.Varun Kasyap
2026-10-14Refs #37212 -- Fixed console tabs bug on shared doctrees.Mike Edmunds
Removed a builder-specific optimization from ConsoleDirective. This fixes a bug where building with shared doctrees (as docs/Makefile does) could result in different output depending on the order of builds. The optimization did not noticeably impact Sphinx build time. This also resolves a RemovedInSphinx11Warning in ConsoleDirective.run() that "'sphinx.environment.BuildEnvironment.app' is deprecated." Thanks to @nessita for review (and for identifying this as a bug, not just a Sphinx deprecation).
2026-10-14Refs #37212 -- Added tests for djangodocs Sphinx extension.Mike Edmunds
Added test cases for djangodocs extension features that weren't yet tested. Added a `build_sphinx()` helper in `SimpleSphinxTestCase` that runs Sphinx on given source text and captures the results. Bumped minimum Sphinx version to 7.3.0, which is where `SphinxTestApp` gained the `verbosity` argument used by `build_sphinx()`. Thanks to @nessita for review and improvements.
2026-10-14Fixed #37424 -- Fixed whitespace handling when parsing max-age directives.Jacob Walls