1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00
Commit Graph

13651 Commits

Author SHA1 Message Date
Simon Charette
03c0a3de72 Refs #373 -- Used a feature flag to disable composite subquery test on MySQL. 2024-11-01 08:15:10 +01:00
Sarah Boyce
2c029c718f Fixed #35876 -- Displayed non-ASCII fieldset names when rendering ModelAdmin.fieldsets.
Thank you to Namhong Kim for the report, and to Mariusz Felisiak and Marijke Luttekes for the review.

Regression in 01ed59f753.
2024-10-31 06:38:07 +01:00
Ben Cail
0eaaadd47f Fixed #35180 -- Recreated PostgreSQL _like indexes when changing between TextField and CharField field types. 2024-10-31 06:37:14 +01:00
Anthony Joseph
3a8f52fbc6 Fixed #35856 -- Added QuerySet.explain() support for MEMORY/SERIALIZE option on PostgreSQL 17+. 2024-10-30 15:54:48 +01:00
Tainara Palmeira
fc22fdd34f Refs #35844 -- Expanded compatibility for expected error messages in command tests on Python 3.12 and 3.13.
Updated CommandTests.test_subparser_invalid_option and CommandDBOptionChoiceTests.test_invalid_choice_db_option to use assertRaisesRegex() for compatibility with modified error messages in Python 3.12, 3.13, and 3.14+..
2024-10-29 22:06:28 +01:00
Mike Edmunds
cf4d902eb5 Refs #35581 -- Reduced boilerplate in mail tests. 2024-10-29 11:13:27 +01:00
Mike Edmunds
00861c4ca7 Refs #35581 -- Identified mail tests that check for Python 2 behavior.
This also removed a duplicate CTE case (that used to be distinct in Python 2).
2024-10-29 11:13:27 +01:00
Mike Edmunds
4d76adfacd Refs #35581 -- Verified attachments in the generated message in mail tests.
This also removed send() calls, as this doesn't check the serialized content, and
the backend tests cover sending.
2024-10-29 11:13:27 +01:00
Mike Edmunds
889be2f455 Refs #35581 -- Clarified some test names and comments in mail tests. 2024-10-29 11:13:27 +01:00
Tainara Palmeira
4c3897bb15 Refs #35844 -- Corrected expected error messages in commands tests on Python 3.14+.
Updated CommandTests.test_subparser_invalid_option and CommandDBOptionChoiceTests.test_invalid_choice_db_option to address changes in Python 3.14+ error handling.
2024-10-25 13:30:11 +02:00
Mariusz Felisiak
34066d6cf3
Refs #35844 -- Fixed tests for test --parallel option on Python 3.14+.
"forkserver" is the new default on POSIX systems, and Django doesn't
support parallel tests with "forkserver":

b65f2cdfa7
2024-10-24 11:41:37 -03:00
Mariusz Felisiak
ef28b05767 Refs #35803 -- Added more tests for __coveredby and __covers GIS lookups.
Co-authored-by: David Smith <smithdc@gmail.com>
2024-10-24 09:06:27 +02:00
Clifford Gama
4d11ea1ef0 Fixed #28999 -- Documented how to reverse a class-based view by instance.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-10-23 15:37:54 +02:00
Clifford Gama
be138f32ed Refs #28999 -- Added tests for reversing a class-based view by instance. 2024-10-23 15:37:54 +02:00
David Smith
04adff9f98
Refs #34406 -- Added support for GDAL curved geometries.
Co-authored-by: Fabien Le Frapper <contact@fabienlefrapper.me>
2024-10-22 17:24:36 -03:00
Nick Pope
3fad712a91 Fixed #35841 -- Restored support for DB-IP databases in GeoIP2.
Thanks Felix Farquharson for the report and Claude Paroz for the
review.

Regression in 40b5b1596f.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-10-17 21:40:53 -03:00
Nick Pope
5873f10177 Refs #35841 -- Adjusted GeoIP2 tests for easier test case extension.
These changes will make it easier to introduce tests for alternate
databases that may have different results without the need to duplicate
lots of the tests definition.
2024-10-17 21:40:53 -03:00
Nick Pope
c37f249ffa Refs #35841 -- Updated GeoIP2 test database files.
The mmdb files were taken from
679e37e18a.
2024-10-17 21:40:53 -03:00
Justin Thurman
99dcc59237 Fixed #35845 -- Updated DomainNameValidator to require entire string to be a valid domain name.
Bug in 4971a9afe5.

Thank you to kazet for the report and Claude Paroz for the review.
2024-10-17 16:45:44 +02:00
Mariusz Felisiak
bd3b1dfa24
Refs #35844 -- Used asgiref.sync.iscoroutinefunction() instead of deprecated asyncio.iscoroutinefunction().
Fixes DeprecationWarning:

'asyncio.iscoroutinefunction' is deprecated and slated for removal in
Python 3.16; use inspect.iscoroutinefunction() instead.
2024-10-17 10:15:10 -03:00
Mariusz Felisiak
48fa531fbc
Refs #35844 -- Added Python 3.14 to daily builds. 2024-10-16 22:19:17 -03:00
SaJH
0c81775515 Refs #35727 -- Updated response.content.decode calls to use the HttpResponse.text property.
Signed-off-by: SaJH <wogur981208@gmail.com>
2024-10-16 11:52:22 +02:00
SaJH
4a685bc0dc Fixed #35727 -- Added HttpResponse.text property.
Signed-off-by: SaJH <wogur981208@gmail.com>
2024-10-16 11:52:22 +02:00
Ben Cail
ec7d69035a Fixed #35782 -- Allowed overriding password validation error messages. 2024-10-15 17:23:39 +02:00
leondaz
06bf06a911 Fixed #35656 -- Added an autodetector attribute to the makemigrations and migrate commands. 2024-10-15 16:39:12 +02:00
Simon Charette
53ea4cce2f
Fixed #35744 -- Relabelled external aliases of combined queries.
Just like normal queries, combined queries' outer references might fully
resolve before their reference is assigned its final alias.

Refs #29338.

Thanks Antony_K for the report and example, and thanks Mariusz Felisiak
for the review.
2024-10-14 20:21:48 -03:00
Bendeguz Csirmaz
97c05a64ca Refs #373 -- Added additional validations to tuple lookups. 2024-10-14 14:51:57 +02:00
Adam Johnson
cee95e6172 Fixed #35717 -- Reduced Create/RemoveCollation operations when optimizing migrations. 2024-10-10 13:18:46 +02:00
ekinertac
68cee15a8f Fixed #35789 -- Improved the error message raised when the tag must be first in the template. 2024-10-10 12:21:02 +02:00
gabn88
e970bb7ca7 Fixed #35103 -- Used provided error code and message when fields is set without a condition on UniqueConstraint. 2024-10-10 09:20:37 +02:00
nessita
679d57816d
Fixed #35809 -- Set background color for selected rows in the admin's form select widget.
Regression in b47bdb4cd9.

Thank you Giannis Terzopoulos for the review, and Tom Carrick and Sarah Boyce
for the review.
2024-10-08 10:01:28 -03:00
GappleBee
a417c0efb4 Fixed #35449 -- Fixed validation of array items in SplitArrayField when remove_trailing_nulls=True. 2024-10-07 15:36:57 +02:00
Jon Janzen
50f89ae850 Fixed #35303 -- Implemented async auth backends and utils. 2024-10-07 14:19:41 +02:00
Marc Gibbons
6765b6adf9
Fixed #35797 -- Removed debug context processor from default project template. 2024-09-30 16:52:28 -03:00
Bendeguz Csirmaz
5ed72087c4 Refs #373 -- Added support for using tuple lookups in filters. 2024-09-26 10:25:49 -04:00
Bendeguz Csirmaz
c2c7dbb2f8 Refs #373 -- Updated TupleIsNull lookup to check if any is NULL rather than all.
Regression in 1eac690d25.
2024-09-20 12:03:35 +02:00
Mariusz Felisiak
1fa8493640 Refs #29522 -- Fixed serializers/fixtures test crash if PyYAML isn't installed. 2024-09-19 08:51:30 +02:00
Mariusz Felisiak
f8cc9285e1 Fixed #35074 -- Fixed adding/removing indexes when spatial_index is changed on MySQL, PostgreSQL, and Oracle.
Co-authored-by: Mário Falcão <mario@falcao.dev>
2024-09-19 08:12:11 +02:00
Sarah Boyce
ae1ee24178 Fixed #35766 -- Handled slices in BaseChoiceIterator. 2024-09-18 16:45:53 +02:00
Bendeguz Csirmaz
9ca1f6eff6 Refs #373, Refs #24121 -- Added ColPairs.__repr__(). 2024-09-17 14:25:58 +02:00
Amir Karimi
ee5147cfd7 Fixed #29522 -- Refactored the Deserializer functions to classes.
Co-authored-by: Emad Mokhtar <emad.mokhtar@veneficus.nl>
2024-09-17 11:00:49 +02:00
Jacob Walls
a060a22ee2 Fixed #35660 -- Made serialized_rollback and fixture data available in TransactionTestCase.setUpClass(). 2024-09-17 09:53:46 +02:00
Jacob Walls
8eca3e9bce Refs #35660 -- Updated TransactionTestCase methods into class or static methods. 2024-09-17 09:53:46 +02:00
Fabian Braun
d2c97981fb Fixed #35735 -- Enabled template access to methods and properties of classes with __class_get_item__. 2024-09-17 09:52:44 +02:00
Lily Foote
d50f61be7f
Improved TokenType.COMMENT test by using correct block syntax in template tests. 2024-09-16 10:30:30 -03:00
Claude Paroz
b579485d99 Fixed #34221 -- Honored translation precedence with mixed plural forms. 2024-09-16 11:04:09 +02:00
suraj
8dd3f7d538 Closed connection pool in clean up of test_allowed_database_copy_queries. 2024-09-13 12:37:37 +02:00
Richard Laager
16af0c60ed Fixed #35755 -- Hid help text of hidden fields in admin fieldsets.
Regression in 96a598356a.
2024-09-12 13:49:07 +02:00
Amir Karimi
b2501759eb Refs #29522 -- Improved test coverage of deserializers. 2024-09-12 13:44:28 +02:00
Gastón Avila
c3ca6075cc Fixed #35732 -- Wrapped ConcatPair expression in parentheses to ensure operator precedence.
When ConcatPair was updated to use || this lost the implicit wrapping from CONCAT(...).
This broke the WHERE clauses when used in combination with PostgreSQL trigram similarity.

Regression in 6364b6ee10.

Co-authored-by: Emiliano Cuenca <106986074+emicuencac@users.noreply.github.com>
2024-09-11 14:36:56 +02:00
Bendeguz Csirmaz
0bfaa55708 Fixed #35752 -- Fixed crash when using In() lookup in filters. 2024-09-11 12:42:17 +02:00
Bendeguz Csirmaz
347ab72c02 Refs #373 -- Improved test coverage of tuple lookup checks.
This also removed unreachable checks.
2024-09-11 11:23:01 +02:00
ldeluigi
2a4321ba23 Fixed #35747 -- Used default ordering when the ORDER_VAR param is blank in the admin changelist. 2024-09-11 10:41:23 +02:00
Csirmaz Bendegúz
5865ff5adc
Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK is set. 2024-09-09 17:46:50 -03:00
Jake Howard
e161bd4657 Fixed #35631 -- Added HttpRequest.get_preferred_type(). 2024-09-09 12:02:18 +02:00
Wassef Ben Ahmed
957c54d945
Fixed #32831 -– Allowed cache tests to be retried via a new "retry" decorator. 2024-09-05 18:25:05 -03:00
Natalia
8c35a0a903 Fixed CVE-2024-45231 -- Avoided server error on password reset when email sending fails.
On successful submission of a password reset request, an email is sent
to the accounts known to the system. If sending this email fails (due to
email backend misconfiguration, service provider outage, network issues,
etc.), an attacker might exploit this by detecting which password reset
requests succeed and which ones generate a 500 error response.

Thanks to Thibaut Spriet for the report, and to Mariusz Felisiak, Adam
Johnson, and Sarah Boyce for the reviews.
2024-09-03 09:22:32 -03:00
Sarah Boyce
320dd27412 Fixed CVE-2024-45230 -- Mitigated potential DoS in urlize and urlizetrunc template filters.
Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report.
2024-09-03 09:22:32 -03:00
Adam Johnson
f5ddd54986 Fixed #35704 -- Fixed reduction for AddIndex subclasses. 2024-09-03 12:51:06 +02:00
Tim Graham
6f9c6678bf Added assertion for the results of migrating an integer pk to SmallAutoField.
Follow up to 7ca42974ee which did the same for
similar tests.
2024-09-03 08:22:39 +02:00
Jacob Walls
4082a8886e Fixed #35724 -- Tested migration commands handling of distributed namespace packages.
Also increased coverage of module_loading.py.
2024-09-03 08:07:53 +02:00
Alex Fischer
c6a4f853c7 Fixed #35712 -- Prevented Q.check() from leaving the connection in an unusable state.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-09-02 17:00:55 +02:00
sanjeevholla26
387475c5b2 Refs #35706 -- Prefixed 'Error:' to titles of admin pages with form errors.
This improves the screen reader experience.
2024-09-02 15:19:33 +02:00
John Parton
e4a2e22ddb Fixed #35690 -- Errored nicely when using in_bulk() with a values() or values_list() queryset. 2024-09-02 15:04:52 +02:00
Sarah Boyce
fd1dd76778 Fixed #35716 -- Fixed VariableDoesNotExist when rendering admin fieldsets.
Regression in 01ed59f753.

Thank you to Fábio Domingues and Marijke Luttekes for the report,
and thank you to Natalia Bidart for the review.
2024-08-30 20:49:27 +02:00
Adam Johnson
20d44abb41 Fixed #35700 -- Added AlterModelTable and AlterModelTableComment reductions. 2024-08-30 18:50:12 +02:00
Vaarun Sinha
884ce37479 Fixed #35083 -- Updated method_decorator to handle async methods.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2024-08-30 08:54:49 -03:00
Claude Paroz
2c1f27d0d0 Dropped safeguards against very old versions of gettext.
gettext 0.19 was released in 2014.
2024-08-30 13:39:04 +02:00
SaJH
2ff00251f9 Fixed #35669 -- Improved max post-process passes exceeded error message in HashedFilesMixin.
Signed-off-by: SaJH <wogur981208@gmail.com>
2024-08-30 10:00:51 +02:00
Sarah Boyce
7380ac5734 Fixed #35688 -- Restored timezone and role setters to be PostgreSQL DatabaseWrapper methods.
Following the addition of PostgreSQL connection pool support in
Refs #33497, the methods for configuring the database role and timezone
were moved to module-level functions. This change prevented subclasses
of DatabaseWrapper from overriding these methods as needed, for example,
when creating wrappers for other PostgreSQL-based backends.

Thank you Christian Hardenberg for the report and to
Florian Apolloner and Natalia Bidart for the review.

Regression in fad334e1a9.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-08-28 19:25:07 -03:00
Simon Charette
57307bbc7d Fixed #35666 -- Documented stacklevel usage and testing, and adjusted test suite accordingly.
Over the years we've had multiple instances of hit and misses when
emitting warnings: either setting the wrong stacklevel or not setting
it at all.

This work adds assertions for the existing warnings that were declaring
the correct stacklevel, but were lacking tests for it.
2024-08-28 11:44:05 -03:00
Simon Charette
39abd56a7f Refs #35405 -- Adjusted deprecation warning stacklevel in FieldCacheMixin.get_cache_name(). 2024-08-28 11:44:05 -03:00
Simon Charette
47f18a7226 Refs #35326 -- Adjusted deprecation warning stacklevel in FileSystemStorage.OS_OPEN_FLAGS. 2024-08-28 11:44:05 -03:00
Simon Charette
52ed2b645e Refs #35060 -- Adjusted deprecation warning stacklevel in Model.save()/asave(). 2024-08-28 11:44:05 -03:00
Simon Charette
a69f895d7d Refs #34547 -- Adjusted deprecation warning stacklevel in DatabaseOperations.field_cast_sql(). 2024-08-28 11:44:05 -03:00
Simon Charette
c042fe3a74 Refs #33735 -- Adjusted warning stacklevel in StreamingHttpResponse.__iter__()/__aiter__(). 2024-08-28 11:44:05 -03:00
Simon Charette
7e6e1c8383 Refs #32339 -- Adjusted deprecation warning stacklevel in transitional form renderers. 2024-08-28 11:44:05 -03:00
Simon Charette
6bd5d4f705 Refs #22712 -- Adjusted deprecation warning stacklevel in staticfiles finders. 2024-08-28 11:44:05 -03:00
Simon Charette
8ee17037ae Refs #16055 -- Adjusted deprecation warning stacklevel in get_joining_columns()/get_reverse_joining_columns(). 2024-08-28 11:44:05 -03:00
Simon Charette
5e81a4e790 Refs #12581 -- Adjusted warning stacklevel in queries ring buffer. 2024-08-28 11:44:05 -03:00
Mariusz Felisiak
07a4d23283
Refs #34900 -- Updated requirements for Python 3.13. 2024-08-28 09:02:47 -03:00
Adam Johnson
2b71b2c8dc
Refs #34609 -- Fixed deprecation warning stack level in format_html().
Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-08-27 15:14:50 -03:00
Tim Graham
bc9b6251e0 Added supports_sequence_reset skip in backends tests. 2024-08-26 12:53:08 -03:00
Tim Graham
6a85c888bf Added supports_select_union skips in queries and aggregation tests. 2024-08-26 12:53:08 -03:00
Maarten Breddels
cdcd604ef8 Fixed #35703 -- Made technical_404_response() respect SCRIPT_NAME to return default_urlconf(). 2024-08-23 18:07:47 +02:00
Giovanni Fabbretti
f72bbd4480 Fixed #35689 -- Handled custom labels in LabelCommand.missing_args_message. 2024-08-23 17:26:28 +02:00
nessita
046a354217
Added helper and refactored PasswordResetFormTest to unify email sending tests. 2024-08-23 11:13:31 -03:00
Hisham Mahmood
519087819e
Fixed #35695 -- Ensured FileFields use a storage pointing to a temp directory in model_fields tests. 2024-08-21 08:51:25 -03:00
Sarah Boyce
d9ae7f5b58 Fixed #35686 -- Added table headers to app list tables for screen readers. 2024-08-20 09:05:16 +02:00
nabil-rady
231c0d8593 Fixed #35668 -- Added mapping support to format_html_join. 2024-08-20 08:20:34 +02:00
Natalia
0ebed5fa95 Fixed #35678 -- Removed "usable_password" field from BaseUserCreationForm.
Refs #34429: Following the implementation allowing the setting of
unusable passwords via the admin site, the `BaseUserCreationForm` and
`UserCreationForm` were extended to include a new field for choosing
whether password-based authentication for the new user should be enabled
or disabled at creation time.
Given that these forms are designed to be extended when implementing
custom user models, this branch ensures that this new field is moved to
a new, admin-dedicated, user creation form `AdminUserCreationForm`.

Regression in e626716c28.

Thanks Simon Willison for the report, Fabian Braun and Sarah Boyce for
the review.
2024-08-19 12:39:57 -03:00
Natalia
b60fd8722f Refs #35678 -- Split tests for BaseUserCreationForm when using a custom User model.
This work also allows to subclass BaseUserCreationFormTest to reuse the
tests and assertions for testing forms that extend BaseUserCreationForm,
which is now used for UserCreationFormTest, increasing its coverage.
2024-08-19 12:39:57 -03:00
Mariusz Felisiak
a57596e443 Refs #35658 -- Fixed test_create_file_field_from_another_file_field_in_memory_storage when run in reverse. 2024-08-15 08:52:19 +02:00
Jacob Walls
b99c608ea1 Refs #35402 -- Added tests for invalid usage of submodules in some settings. 2024-08-13 16:09:52 +02:00
Simon Charette
602fe961e6 Fixed #35665 -- Fixed a crash when passing an empty order_by to Window.
This also caused un-ordered sliced prefetches to crash as they rely on Window.

Regression in e16d0c176e that made OrderByList
piggy-back ExpressionList without porting the empty handling that the latter
provided.

Supporting explicit empty ordering on Window functions and slicing is arguably
a foot-gun design due to how backends will return undeterministic results but
this is a problem that requires a larger discussion.

Refs #35064.

Thanks Andrew Backer for the report and Mariusz for the review.
2024-08-13 11:26:17 +02:00
Matthias Kestenholz
d84200e4eb Fixed #35648 -- Raised NotImplementedError in SafeString.__add__ for non-string RHS.
This change ensures SafeString addition operations handle non-string RHS
properly, allowing them to implement __radd__ for better compatibility.
2024-08-12 14:25:05 -03:00
Matthias Kestenholz
b5c048f5ec Refs #35648 -- Added test for addition between SafeString and str in utils_tests. 2024-08-12 14:25:05 -03:00
Devin Cox
e03083917d Fixed #35586 -- Added support for set-returning database functions.
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres.

Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-08-12 15:35:19 +02:00
Mark Gensler
228128618b Fixed #35575 -- Added support for constraint validation on GeneratedFields. 2024-08-12 13:45:57 +02:00
Mariusz Felisiak
f883bef054 Refs #35591 -- Removed hardcoded "stable" version in runserver warning. 2024-08-12 10:57:02 +02:00