summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-07-24[5.1.x] Fixed #35604, Refs #35326 -- Made FileSystemStorage.exists() ↵Sarah Boyce
behaviour independent from allow_overwrite. Partially reverts 0b33a3abc2ca7d68a24f6d0772bc2b9fa603744e. Storage.exists(name) was documented to "return False if the name is available for a new file." but return True if the file exists. This is ambiguous in the overwrite file case. It will now always return whether the file exists. Thank you to Natalia Bidart and Josh Schneier for the review. Backport of 8d6a20b656ff3fa18e36954668a44a831c2f6ddd from main.
2024-07-24[5.1.x] Updated asgiref dependency for 5.1 release series.Mariusz Felisiak
Backport of df35cf578f99522dd1ba864d513be95d47bab7a5 from main.
2024-07-18[5.1.x] Fixed #35603 -- Prevented F.__contains__() from hanging.Simon Charette
Regression in 94b6f101f7dc363a8e71593570b17527dbb9f77f. Backport of 6b3f55446fdc62bd277903fd188a1781e4d92d29 from main.
2024-07-18[5.1.x] Fixed #35606, Refs #34045 -- Fixed rendering of ↵Hisham Mahmood
ModelAdmin.action_checkbox for models with a __html__ method. Thank you Claude Paroz for the report. Regression in 85366fbca723c9b37d0ac9db1d44e3f1cb188db2. Backport of 182f262b15882649bbc39d769f9b721cf3660f6f from main.
2024-07-17[5.1.x] Fixed #35594 -- Added unique nulls distinct validation for expressions.Simon Charette
Thanks Mark Gensler for the report. Backport of adc0b6aac3f8a5c96e1ca282bc9f46e28d20281c from main.
2024-07-17[5.1.x] Refs #30581 -- Made unattached UniqueConstraint(fields) validation ↵Simon Charette
testable. The logic allowing UniqueConstraint(fields).validate to preserve backward compatiblity with Model.unique_error_message failed to account for cases where the constraint might not be attached to a model which is a common pattern during testing. This changes allows for arbitrary UniqueConstraint(fields) to be tested in isolation without requiring actual models backing them up. Co-authored-by: Mark G <mark.gensler@protonmail.com> Backport of 13922580cccfb9ab2922ff4943dd39da56dfbd8c from main.
2024-07-16[5.1.x] Refs #10941 -- Renamed test file test_query_string.py to ↵nessita
test_querystring.py. This follows previous renames made in 27043bde5b795eb4a605aeca1d3bc4345d2ca478. Backport of 5dc17177c38662d6f4408258ee117cd80e0cb933 from main.
2024-07-15[5.1.x] Refs #10941 -- Renamed query_string template tag to querystring.Sarah Boyce
Backport of 27043bde5b795eb4a605aeca1d3bc4345d2ca478 from main.
2024-07-15[5.1.x] Refs #35560 -- Corrected required feature flags in ↵Mariusz Felisiak
GeneratedModelUniqueConstraint. Backport of 2d3bb414cfb2778cc64f22e7203102d7389f81e6 from main.
2024-07-09[5.1.x] Fixed CVE-2024-39614 -- Mitigated potential DoS in ↵Sarah Boyce
get_supported_language_variant(). Language codes are now parsed with a maximum length limit of 500 chars. Thanks to MProgrammer for the report.
2024-07-09[5.1.x] Fixed CVE-2024-39330 -- Added extra file name validation in ↵Natalia
Storage's save method. Thanks to Josh Schneier for the report, and to Carlton Gibson and Sarah Boyce for the reviews.
2024-07-09[5.1.x] Fixed CVE-2024-39329 -- Standarized timing of verify_password() when ↵Michael Manfre
checking unusuable passwords. Refs #20760. Thanks Michael Manfre for the fix and to Adam Johnson for the review.
2024-07-09[5.1.x] Fixed CVE-2024-38875 -- Mitigated potential DoS in urlize and ↵Adam Johnson
urlizetrunc template filters. Thank you to Elias Myllymäki for the report. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-07-04[5.1.x] Fixed #35560 -- Made Model.full_clean() ignore GeneratedFields for ↵Mark Gensler
constraints. Accessing generated field values on unsaved models caused a crash when validating CheckConstraints and UniqueConstraints with expressions. Backport of 1005c2abd1ef0c156f449641e38c33e473989d37 from main.
2024-06-26[5.1.x] Fixed #35561 -- Made *args and **kwargs parsing more strict in ↵nessita
Model.save()/asave(). Backport of e56a32b89bb7fadffdfaa2cdf12b4863ccd5af9b from main.
2024-06-25[5.1.x] Fixed #35558 -- Increased inline H3 headers color prominence in ↵Sarah Boyce
admin change page. Backport of e510bb1ab1fb22837c169e0459b81cf388b6d8d2 from main.
2024-06-25[5.1.x] Fixed #35554, Refs #35060 -- Corrected deprecated *args parsing in ↵Adam Johnson
Model.save()/asave(). The transitional logic added to deprecate the usage of *args for Model.save()/asave() introduced two issues that this branch fixes: * Passing extra positional arguments no longer raised TypeError. * Passing a positional but empty update_fields would save all fields. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Backport of 28522c3c8d5eb581347aececc3ac61c134528114 from main.
2024-06-25[5.1.x] Refs #35059 -- Used asyncio.Event in ↵Carlton Gibson
ASGITest.test_asyncio_cancel_error to enforce specific interleaving. Sleep call leads to a hard to trace error in CI. Using an Event is more deterministic, and should be less prone to environment variations. Bug in 11393ab1316f973c5fbb534305750740d909b4e4. Backport of f4a08b6ddfcacadfe9ff8364bf1c6c54f5dd370f from main.
2024-06-24[5.1.x] Fixed #35545, Refs #32833 -- Fixed ↵Sarah Boyce
ContentTypeManager.get_for_models() crash in CreateModel migrations. Thank you to Csirmaz Bendegúz for the report and Simon Charettes for the review. Backport of f1705c8780c0a7587654fc736542d55fe4a7f29b from main.
2024-06-20[5.1.x] Simplified OperationTestCase.alter_gis_model() test hook a bit.Mariusz Felisiak
This avoids passing "blank=False" and "srid=4326" to field classes, which are the default values, and removes special treatment for the "blank" parameter. Backport of a0c44d4e23f8f509757f97f28fbbb1ced3382361 from main.
2024-06-20[5.1.x] Refs #35074 -- Avoided failed attempts to remove spatial indexes on ↵Mariusz Felisiak
nullable fields on MySQL. MySQL doesn't support spatial indexes on NULL columns, so there is no point in removing them. Backport of 20c2d625d3d5062e43918d1d7b6f623202491dd4 from main.
2024-06-17[5.1.x] Fixed #35483 -- Added NUL (0x00) character validation to ↵Alexander Lötvall
ModelChoiceFields. Applied the ProhibitNullCharactersValidator to ModelChoiceField and ModelMultipleChoiceField. Co-authored-by: Viktor Paripás <viktor.paripas@gmail.com> Co-authored-by: Vasyl Dizhak <vasyl@dizhak.com> Co-authored-by: Arthur Vasconcelos <vasconcelos.arthur@gmail.com> Backport of 38ad710aba885ad26944ff5708ce1a02a446d2d3 from main.
2024-06-14[5.1.x] Refs #34881 -- Fixed ↵Mariusz Felisiak
OperationTests.test_rename_m2m_field_with_2_references() test on Oracle. Backport of fa7848146738a9fe1d415ee4808664e54739eeb7 from main.
2024-06-14[5.1.x] Fixed mail.tests.MailTests.test_backend_arg() test on Python 3.13+.Mariusz Felisiak
There is no point in asserting Python error messages. Backport of 4ee68bb4f50dbe842461f8f340bb1633fddd4a53 from main.
2024-06-14[5.1.x] Fixed #34881 -- Fixed a crash when renaming a model with multiple ↵Anže Pečar
ManyToManyField.through references on SQLite. Thank you to dennisvang for the report and Jase Hackman for the test. Co-authored-by: Jase Hackman <jase.hackman@zapier.com> Backport of e99187e5c94516ee35f37cc41a36d906b395808d from main.
2024-06-14[5.1.x] Fixed #35488 -- Fixed BaseModelFormSet.validate_unique() crash due ↵Madalin Popa
to unhashable type. Backport of d28626ecf8bd340084ed70ff2d88e8dbab001e2c from main.
2024-06-14[5.1.x] Fixed #35417 -- Updated BaseContext.new() with values to create a ↵George Y. Kussumoto
context that can be flattened. Backport of 2a32b233822683c51e59722b7c9aa0789fc4ab1b from main.
2024-06-14[5.1.x] Fixed #34789 -- Prevented updateRelatedSelectsOptions fromDevin Cox
adding entries to filter_horizontal chosen box. Co-authored-by: yokeshwaran1 <yokesh440@yahoo.com> Backport of 719a42b589d7551fc84708044b9e984ce723c8a2 from main.
2024-06-14[5.1.x] Fixed #35469 -- Removed deferred SQL to create index removed by ↵Jacob Walls
AlterField operation. Backport of 99f23eaabd8da653f046dc1d19f5008c030a4f79 from main.
2024-06-14[5.1.x] Fixed #35443 -- Changed ordinal to return negative numbers unchanged.Simon Törnqvist
Previously, `-1` was converted to `"-1th"`. This has been updated to return negative numbers "as is", so that for example `-1` is converted to `"-1"`. This is now explicit in the docs. Co-authored-by: Martin Jonson <artin.onson@gmail.com> Backport of d3a7ed5bcc45000a6c3dd55d85a4caaa83299f83 from main.
2024-05-30[5.1.x] Fixed #35477 -- Corrected 'required' errors in auth password ↵Fabian Braun
set/change forms. The auth forms using SetPasswordMixin were incorrectly including the 'This field is required.' error when additional validations (e.g., overriding `clean_password1`) were performed and failed. This fix ensures accurate error reporting for password fields. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Backport of 339977d4441fd353e20950b98bad3d42afb1f126 from main.
2024-05-22[5.1.x] Fixed #35472 -- Used temporary directory in test_imagefield.NoReadTests.Sarah Boyce
Backport of 7e39ae5c8cf4c6601a4f47b72914349481c5331b from main.
2024-05-22Fixed #35393 -- Added excluded pk as a hidden field to the inline admin.Willem Van Onsem
2024-05-22Fixed #31405 -- Added LoginRequiredMiddleware.Hisham Mahmood
Co-authored-by: Adam Johnson <me@adamj.eu> Co-authored-by: Mehmet İnce <mehmet@mehmetince.net> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-05-22Fixed #35189 -- Improved admin collapsible fieldsets by using <details> ↵Marijke Luttekes
elements. This work improves the accessibility of the add and change pages in the admin site by adding <details> and <summary> elements to the collapsible fieldsets. This has the nice side effect of no longer requiring custom JavaScript helpers to implement the fieldsets' show/hide capabilities. Thanks to James Scholes for the accessibility advice, and to Sarah Boyce and Tom Carrick for reviews. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-05-22Refs #35189 -- Improved admin fieldset's accessibility by setting ↵Marijke Luttekes
aria-labelledby. Before this change, HTML <fieldset> elements in the admin site did not have an associated label to describe them. This commit defines a unique HTML id for the heading labeling a fieldset, and sets its aria-labelledby property to link the heading with the fieldset.
2024-05-22Fixed #35139 -- Prevented file read after ImageField is saved to storage.John Parton
2024-05-21Fixed #18119 -- Added a DomainNameValidator validator.Berker Peksag
Thanks Claude Paroz for the review. Co-authored-by: Nina Menezes <77671865+nmenezes0@users.noreply.github.com>
2024-05-21Fixed #35405 -- Converted get_cache_name into a cached property in ↵Adam Johnson
FieldCacheMixin. FieldCacheMixin is used by related fields to track their cached values. This work migrates get_cache_name() to be a cached property to optimize performance by reducing unnecessary function calls when working with related fields, given that its value remains constant. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-05-21Removed hardcoded docs version in csrf template.Ryan Hiebert
2024-05-21Fixed #35326 -- Added allow_overwrite parameter to FileSystemStorage.Ben Cail
2024-05-17Fixed #35428 -- Increased parallelism of the ScryptPasswordHasher.SaJH
2024-05-16Fixed typos in test docstrings.Mariusz Felisiak
2024-05-15Fixed #35384 -- Raised FieldError when saving a file without a name to ↵Jonny Park
FileField.
2024-05-14Fixed #29942 -- Restored source file linking in docs by using the Sphinx ↵Joachim Jablon
linkcode ext. Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-05-14Fixed #35275 -- Fixed Meta.constraints validation crash on UniqueConstraint ↵Mariusz Felisiak
with OpClass(). This also introduces Expression.constraint_validation_compatible that allows specifying that expression should be ignored during a constraint validation.
2024-05-13Fixed #35408 -- Optimized post-migrate permission creation.Adam Johnson
co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-05-10Added tests for Storage's generate_filename method.nessita
2024-05-10Fixed #35429 -- Added argparse choices to --database options.SaJH
2024-05-10Fixed #35436 -- Fixed displaying Unicode chars in forms.HStoreField.SaJH