1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00
Commit Graph

13571 Commits

Author SHA1 Message Date
Sarah Boyce
f973a70bfc
Made postgresql.tests.Tests.test_connect_pool less flaky by increasing timeout value. 2024-04-10 14:09:52 -03:00
Natalia
338ec052b4 Refs #35361 -- Added test for Email line length checks when dealing with surrogate pairs.
Refs #33173, #34118 and #34900.
2024-04-10 17:56:55 +02:00
Sarah Boyce
8b53560eea Fixed #35350 -- Fixed save() with pk set on models with GeneratedFields.
Thanks Matt Hegarty for the report and Simon Charette and Natalia Bidart for the reviews.

Regression in f333e35.
2024-04-10 15:43:50 +02:00
Carlton Gibson
bcd255cd5c Fixed #35354 -- Simplified ASGIRequest path handling.
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-05 11:35:38 +02:00
Carlton Gibson
4d2ef9bb82 Refs #35169 -- Added test for ASGIRequest root_path handling. 2024-04-05 11:30:33 +02:00
Sarah Boyce
89403dbedd Fixed SeleniumTests.test_related_object_update_with_camel_casing() assert.
A selenium web element was compared to a string rather than its innerHTML.
2024-04-03 09:29:01 +02:00
devin13cox
8665cf03d7
Fixed #35330 -- Fixed the update of related widgets when the referenced model is camel case named.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-04-02 22:00:25 -03:00
Simon Charette
888b9042b3
Fixed #35336 -- Addressed crash when adding a GeneratedField with % literals.
A longer term solution is likely to have a better separation of parametrized
DDL altogether to handle checks, constraints, defaults, and generated fields
but such a change would require a significant refactor that isn't suitable
for a backport.

Thanks Adrian Garcia for the report.
2024-04-02 17:33:31 -03:00
Johannes Westphal
5f18021640 Fixed #35344, Refs #34838 -- Corrected output_field of resolved columns for GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
2024-04-01 18:54:38 +01:00
Fabian Braun
944745afe2 Fixed #34977 -- Improved accessibility in the UserChangeForm by replacing the reset password link with a button.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-03-27 16:40:41 -03:00
Giannis Terzopoulos
d658a3162f Fixed #35233 -- Moved template engine system checks to backend methods.
Thanks Adam Johnson for reviews.
2024-03-27 08:14:54 +01:00
Mariusz Felisiak
b98271a6e4
Fixed #35329 -- Fixed migrations crash when adding partial unique constraints with nulls_distinct.
Bug in 595a2abb58.

Thanks Lucas Lemke Saunitti for the report.
2024-03-26 22:58:47 +01:00
Mariusz Felisiak
a2dcc4ecbb
Increased test coverage for django.db.migrations.operations.special. 2024-03-25 08:31:32 +01:00
Ben Cail
07c8d979ae Fixed #35323 -- Prevented file_move_safe() from trying to overwrite existing file when allow_overwrite is False. 2024-03-24 16:05:36 +01:00
Mariusz Felisiak
1c11dba835
Added ModelState.from_model() test for abstract model with unnamed indexes. 2024-03-22 13:31:33 +01:00
sharonwoo
6a37e9bfae Fixed #35257 -- Corrected resolving output_field for IntegerField/DecimalField with NULL. 2024-03-21 10:13:54 +01:00
Mariusz Felisiak
6f7c0a4d66
Fixed ResourceWarning from unclosed SQLite connection in test_utils on Python 3.13+.
On SQLite, close() doesn't explicitly close in-memory connections.

Follow up to 921670c694 and
dd45d5223b.
2024-03-20 11:44:30 +01:00
Laurent Lyaudet
f2388a4b73 Fixed #35309 -- Made prefetch clear ordering for single-valued relationships. 2024-03-20 05:26:18 +01:00
Mariusz Felisiak
921670c694
Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.
On SQLite, close() doesn't explicitly close in-memory connections.

Follow up to dd45d5223b.
2024-03-19 10:03:12 +01:00
Claude Paroz
10b31eea33 Refs #31014 -- Added srid argument to FromWKB/FromWKT() GIS functions. 2024-03-18 09:45:33 +01:00
Adam Johnson
7646b9023d
Fixed #35301 -- Fixed Options._property_names for overriden properties.
Regression in faeb92ea13.
2024-03-17 09:43:04 +01:00
Adam Johnson
cbf1e87398 Fixed #35294 -- Fixed TEXT format of QuerySet.explain() for long plans.
co-authored-by: Gordon <gordon.wrigley@gmail.com>
co-authored-by: Simon Charette <charette.s@gmail.com>
2024-03-15 06:58:14 +01:00
Ben Cail
593067a8ee Fixed #28541 -- Fixed migrations crash when changing primary key on SQLite. 2024-03-14 20:56:43 +01:00
Johannes Maron
3d7235c67b Refs #34488 -- Made ClearableFileInput preserve "Clear" checked attribute when form is invalid. 2024-03-14 14:03:14 +01:00
Johannes Maron
e69019555d Fixed #35273 -- Fixed rendering AdminFileWidget's attributes.
Regression in 8a6c0203c4.
2024-03-14 14:03:09 +01:00
Jon Janzen
f5c340684b Fixed #34901 -- Added async-compatible interface to session engines.
Thanks Andrew-Chen-Wang for the initial implementation which was posted
to the Django forum thread about asyncifying contrib modules.
2024-03-13 17:55:15 +01:00
Mariusz Felisiak
33c06ca0da
Refs #32673, Refs #35295 -- Avoided wrapping rhs direct values in lookups. 2024-03-13 17:46:37 +01:00
Claude Paroz
894fa55da1
Applied BoundingCircle test to only one country.
Looks like testing the second Country is much more computing-intensive
and brings nothing to the test.
2024-03-10 20:59:36 +01:00
Giannis Terzopoulos
73df8b54a2 Fixed #35044 -- Avoided clearing reverse relations and private fields when accessing deferred fields.
Regression in a7b5ad8b19 for reverse
relations and possibly in 123b1d3fcf for
private fields.
2024-03-08 11:09:54 +01:00
Giannis Terzopoulos
0c690c6001 Refs #35044 -- Added Model.refresh_from_db(fields=...) test for clearing reverse relations. 2024-03-08 10:27:19 +01:00
Ben Cail
1570ef02f3 Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when validating empty values.
Thanks Brian Ibbotson for the report.

Regression in 7414704e88.
2024-03-08 05:55:25 +01:00
Dingning
549320946d Fixed #35030 -- Made django.contrib.auth decorators to work with async functions. 2024-03-07 09:59:33 +01:00
cuinix
20848bcf39 Fixed typos in docstrings and docs.
Signed-off-by: cuinix <915115094@qq.com>
2024-03-07 06:01:01 +01:00
Mariusz Felisiak
c4df2a7776
Refs #35030 -- Added more tests for @user_passes_test decorator. 2024-03-06 13:28:32 +01:00
Michail Chatzis
4426b1a72d Fixed #35021 -- Fixed capturing queries when using client-side parameters binding with psycopg 3+. 2024-03-06 11:24:58 +01:00
Adam Johnson
eff21d8e7a Fixed #35252 -- Optimized _route_to_regex().
co-authored-by: Nick Pope <nick@nickpope.me.uk>
2024-03-05 13:09:10 +01:00
Mariusz Felisiak
241adf678f
Used sys_platform in tests requirements.
We already use implementation_name and python_version markers
so it's more consistent. Moreover, marker values can be specified
via pip's command line options.
2024-03-05 13:08:23 +01:00
Adam Zapletal
3d4fe39bac Refs #21286 -- Removed invalid commented out models and tests from serializer tests.
FileField/ImageField cannot be primary keys, so serialization support
for this case will not be implemented.

XMLField was removed in d1290b5b43.
2024-03-04 11:38:18 +01:00
Mariusz Felisiak
838659ea21
Updated fuzzy translations in tests.i18n.patterns.
Follow up to 9fd1b6f3f8.
2024-03-04 11:24:21 +01:00
Shai Berger
f6ad8c7676 Refs CVE-2024-27351 -- Forwardported release notes and tests.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-03-04 08:22:00 +01:00
Kasun Herath
f5ed4306bb
Fixed #35265 -- Added AdminSite tests for changing titles. 2024-03-04 05:34:42 +01:00
Adam Johnson
c187417611
Refs #9847 -- Added tests for handler403 resolution. 2024-03-04 05:24:36 +01:00
Adam Johnson
595738296f Refs #26431 -- Added more test for translated path(). 2024-03-02 19:54:21 +01:00
Adam Johnson
9fd1b6f3f8 Updated translation catalogs in tests.i18n.patterns. 2024-03-02 19:54:21 +01:00
Sarah Boyce
fad334e1a9 Refs #33497 -- Added connection pool support for PostgreSQL.
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Ran Benita <ran@unusedvar.com>
2024-03-01 09:01:18 +01:00
Simon Charette
daf7d482db Refs #35234 -- Deprecated CheckConstraint.check in favor of .condition.
Once the deprecation period ends CheckConstraint.check() can become the
documented method that performs system checks for BaseConstraint
subclasses.
2024-03-01 07:15:32 +01:00
Simon Charette
f82c67aa21 Fixed #35234 -- Added system checks for invalid model field names in ExclusionConstraint.expressions. 2024-02-29 12:22:17 +01:00
Shafiya Adzhani
a738281265 Fixed #35198 -- Fixed facet filters crash on querysets with no primary key.
Thanks Simon Alef for the report.

Regression in 868e2fcdda.
2024-02-29 10:01:18 +01:00
Mariusz Felisiak
0e84e70bc8
Refs #35090 -- Fixed urlpatterns.tests.SimplifiedURLTests when run in reverse. 2024-02-29 08:22:03 +01:00
Adam Zapletal
107aa76bcf Fixed #29022 -- Fixed handling protocol-relative URLs in ManifestStaticFilesStorage when STATIC_URL is set to /. 2024-02-28 06:24:24 +01:00
David Wobrock
ef2434f850
Refs #32114 -- Fixed test crash on non-picklable objects in subtests when PickleError is raised.
Related to the https://github.com/python/cpython/issues/73373.

Follow up to c09e8f5fd8.
2024-02-26 17:18:48 +01:00
Adam Johnson
73d5eb8084 Fixed #35241 -- Cached model's full parent list.
co-authored-by: Keryn Knight <keryn@kerynknight.com>
co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
co-authored-by: David Smith <smithdc@gmail.com>
co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
2024-02-26 05:38:31 +01:00
Salvo Polizzi
6e1ece7ed5 Fixed #35090 -- Deprecated registering URL converters with the same name. 2024-02-23 15:54:49 +01:00
Florian Apolloner
50e95ad536 Simplified using DATABASES["OPTIONS"].
DATABASES["OPTIONS"] are always configured.
2024-02-23 07:49:43 +01:00
Mariusz Felisiak
f835787f71
Refs #32114 -- Fixed RemoteTestResultTest.test_unpicklable_subtest test without tblib.
Follow up to c09e8f5fd8.
2024-02-22 06:27:39 +01:00
Sulabh Katila
eceb5e2eea
Fixed #34806 -- Made cached_db session backend resilient to cache write errors.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-02-21 21:51:58 -03:00
David Wobrock
c09e8f5fd8 Fixed #32114 -- Fixed parallel test crash on non-picklable objects in subtests. 2024-02-21 12:04:03 +01:00
Mariusz Felisiak
a269d8d1d8
Removed obsolete test_get_or_create_raises_IntegrityError_plus_traceback() test.
This test was added in 31b1cbc623, but is
no longer needed, as the fix was reverted in
746caf3ef8 without any consequences, so
it now tests Python behavior rather than Django. Moreover, traceback
introspection is problematic for .pyc-only installations.
2024-02-21 11:50:22 +01:00
Simon Charette
abe6c1f93e Refs #30913 -- Corrected IndexesTests.test_index_include_pointing_to_fk().
This adjusts a test assigning an Index to Meta.constraints.
2024-02-21 08:25:41 +01:00
AlexCLeduc
a084c5d35a Fixed #35238 -- Fixed database serialization crash when base managers use prefetch_related().
Regression in 1391356276
following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
2024-02-20 22:14:17 +01:00
Adam Zapletal
eb2d49b734 Fixed #23759 -- Preserved all file extensions in Storage.get_available_name(). 2024-02-20 21:06:39 +01:00
Mariusz Felisiak
3426a5c33c
Refs #34900 -- Fixed CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+.
c4a2e8a2c5
2024-02-20 20:59:26 +01:00
Fabian Braun
e626716c28 Fixed #34429 -- Allowed setting unusable passwords for users in the auth forms.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-02-20 12:13:32 -03:00
Natalia
8a757244f9 Refs #34429 -- Defined test user with unusable password for auth forms tests. 2024-02-20 12:12:37 -03:00
Mariusz Felisiak
5f637a8a8d
Fixed #35226 -- Reallowed executing queries for dynamically created connections.
Regression in 8fb0be3500.

Thanks Florian Apolloner for the report.
2024-02-19 18:34:18 +01:00
Mariusz Felisiak
9350308f37
Fixed closing connections in test_utils.tests.AllowedDatabaseQueriesTests. 2024-02-19 14:08:30 +01:00
Adam Johnson
f65f8ab84e Refs #28011 -- Removed ForeignObjectRel.is_hidden(). 2024-02-19 12:22:46 +01:00
Adam Johnson
f25d84f61a Fixed #35232 -- Cached model's Options.verbose_name_raw. 2024-02-19 06:05:52 +01:00
Adam Johnson
28a3fbe004
Fixed #35229 -- Made URL custom error handler check run once. 2024-02-19 05:58:37 +01:00
Adam Johnson
5e80390add
Fixed #35230 -- Added cached ForeignObjectRel.accessor_name. 2024-02-19 05:47:12 +01:00
Aaron Linville
7a05b8a2fa Fixed #24018 -- Allowed setting pragma options on SQLite. 2024-02-16 12:59:19 +01:00
ontowhee
66e47ac69a Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on a many to many relation.
Co-Authored-By: Shiwei Chen <april.chen.0615@gmail.com>
2024-02-16 08:57:16 +01:00
Simon Charette
0d8fbe2ade Refs #34060 -- Fixed crash when filtering against literal JSON with psycopg2. 2024-02-16 07:40:33 +01:00
Albert Defler
c991602ce5 Fixed #34060 -- Fixed migrations crash when adding check constraints with JSONField __exact lookup on Oracle. 2024-02-15 13:57:58 +01:00
Shafiya Adzhani
22285d366c Fixed #33037 -- Fixed Trunc() with offset timezones on MySQL, SQLite, Oracle. 2024-02-15 10:02:57 +01:00
Shafiya Adzhani
2aa8388110 Improved test helpers in truncated date/time field tests.
Co-authored-by: Lily Foote <code@lilyf.org>
2024-02-15 10:02:53 +01:00
Hisham Mahmood
8db593de05
Fixed #35173 -- Fixed ModelAdmin.lookup_allowed() for lookups on foreign keys when not included in ModelAdmin.list_filter.
Regression in f80669d2f5.

Thanks Sarah Boyce for the review.
2024-02-14 22:29:49 -03:00
Salvo Polizzi
e6fa74f020 Fixed #35179 -- Made admindocs detect positional/keyword-only arguments. 2024-02-14 13:17:40 +01:00
Moein Bbp
cf107fe255 Fixed #35122 -- Made migrate --prune option respect --app_label. 2024-02-13 14:47:49 +01:00
David Smith
222bf2932b Refs #35058 -- Added support for measured geometries to GDAL GeometryCollection and subclasses. 2024-02-12 15:21:11 +01:00
Daniel Garcia Moreno
bc8471f0aa Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.2+.
Python 3.12.2 bring back the skipped tests in the number of running
tests. Refs
0a737639dc
2024-02-10 16:14:51 +01:00
David Sanders
06264258dc Fixed #35175 -- Made migraton writer preserve keyword-only arguments.
Thanks Gerald Goh for the report.
2024-02-09 09:37:13 +01:00
Ben Cail
8b7ddd1b62 Refs #34534 -- Reduced constraint operations with Meta.constraints when optimizing migrations. 2024-02-09 07:02:52 +01:00
bcail
9c5e382b98
Fixed #35073 -- Avoided unnecessary calling of callables used by SET/SET_DEFAULT in Collector.collect(). 2024-02-08 18:41:32 +01:00
Vašek Dohnal
1b5338d03e Fixed #35174 -- Fixed Signal.asend()/asend_robust() crash when all receivers are asynchronous.
Regression in e83a88566a.
2024-02-08 11:36:28 +01:00
Mariusz Felisiak
2f14c2cedc
Fixed #35172 -- Fixed intcomma for string floats.
Thanks Warwick Brown for the report.

Regression in 55519d6cf8.
2024-02-08 10:58:54 +01:00
Hisham Mahmood
d79fba7d8e Fixed #35099 -- Prevented mutating queryset when combining with & and | operators.
Thanks Alan for the report.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-02-07 12:36:30 +01:00
David Smith
6ee37ada32 Fixed #30686 -- Used Python HTMLParser in utils.text.Truncator. 2024-02-07 09:46:25 +01:00
David Smith
70f39e46f8 Refs #30686 -- Fixed text truncation for negative or zero lengths. 2024-02-07 05:18:35 +01:00
nessita
3e820d10f8
Refs #10743 -- Removed leftover comment in tests/admin_changelist/tests.py. 2024-02-06 16:50:54 -03:00
David Smith
48a4693951 Refs #30686 -- Improved test coverage of Truncator. 2024-02-06 16:35:08 +01:00
Adam Johnson
55519d6cf8 Fixed CVE-2024-24680 -- Mitigated potential DoS in intcomma template filter.
Thanks Seokchan Yoon for the report.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Shai Berger <shai@platonix.com>
2024-02-06 09:07:31 -03:00
Tom Carrick
9cefdfc43f Refs #10743 -- Enabled ordering for lookups in ModelAdmin.list_display.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Nina Menezes <https://github.com/nmenezes0>
2024-02-05 21:42:04 -03:00
Tom Carrick
4ade8386eb Fixed #10743 -- Allowed lookups for related fields in ModelAdmin.list_display.
Co-authored-by: Alex Garcia <me@alexoteiza.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Nina Menezes <https://github.com/nmenezes0>
2024-02-05 21:42:04 -03:00
Rinat Khabibiev
3580b47ed3 Fixed #27225 -- Added "Age" header when fetching cached responses.
Co-Authored-By: Author: Alexander Lazarević <laza@e11bits.com>
2024-02-05 13:27:51 +01:00
Alexander Lazarević
4b1cd8edc1 Corrected cache_page()'s timeout value in tests.generic_views.urls. 2024-02-05 13:27:51 +01:00
Ben Cail
02a600ff67 Fixed #16281 -- Fixed ContentType.get_object_for_this_type() in a multiple database setup. 2024-02-05 08:25:23 +01:00
Simon Charette
e67d7d70fa Fixed #35149 -- Fixed crashes of db_default with unresolvable output field.
Field.db_default accepts either literal Python values or compilables
(as_sql) and wrap the former ones in Value internally.

While 1e38f11 added support for automatic resolving of output fields for
types such as str, int, float, and other unambigous ones it's cannot do
so for all types such as dict or even contrib.postgres and contrib.gis
primitives.

When a literal, non-compilable, value is provided it likely make the
most sense to bind its output field to the field its attached to avoid
forcing the user to provide an explicit `Value(output_field)`.

Thanks David Sanders for the report.
2024-02-04 09:39:41 +01:00
Simon Charette
fe1cb62f5c Refs #35149 -- Made equivalent db_default alterations noops.
This allows for an easier transition of preserving the literal nature of
non-compilable db_default.
2024-02-04 09:31:06 +01:00
Simon Charette
dfc77637ea Fixed #35162 -- Fixed crash when adding fields with db_default on MySQL.
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT,
GEOMETRY or JSON columns and requires expression to be used instead.

Regression in 7414704e88.
2024-02-03 22:47:40 +01:00
James Thorniley
11393ab131 Fixed #35059 -- Ensured that ASGIHandler always sends the request_finished signal.
Prior to this work, when async tasks that process the request are cancelled due
to receiving an early "http.disconnect" ASGI message, the request_finished
signal was not being sent, potentially leading to resource leaks (such as
database connections).

This branch ensures that the request_finished signal is sent even in the case
of early termination of the response.

Regression in 64cea1e48f.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2024-01-31 14:40:57 -03:00
Natalia
a43d75e81d Refs #35059 -- Made asgi tests' SignalHandler helper class re-usable by other tests. 2024-01-31 14:39:40 -03:00
Mariusz Felisiak
38eaf2f21a
Fixed #35159 -- Fixed dumpdata crash when base querysets use prefetch_related().
Regression in 1391356276
following deprecation in edbf930287.

Thanks Andrea F for the report.
2024-01-31 16:10:05 +01:00
David Smith
d3922e9e5a
Refs #35058 -- Added support for measured geometries to GDAL Polygon. 2024-01-31 13:11:16 +01:00
Marijke Luttekes
b9e2a3fc63 Fixed #35143 -- Improved accessibility of 404/500 debug pages.
This:
- changes the header, main, and footer content areas to be rendered
  in a <header>, <main>, and <footer> tags,
- adds scope attributes to <th>,
- uses <code> for a patterns list,
- uses <small> instead of <span>.
2024-01-31 12:26:00 +01:00
Anže Pečar
a0204ac183 Fixed #29280 -- Made the transactions behavior configurable on SQLite. 2024-01-30 11:42:34 +01:00
Nicolas Delaby
820c5f1bac Fixed #35135 -- Made FilteredRelation raise ValueError on querysets as rhs.
Regression in 59f4754704.
2024-01-29 20:29:49 +01:00
Alexander Lazarević
22785f0d6b Refs #35141 -- Corrected value of CACHE_MIDDLEWARE_SECONDS in CacheMiddlewareTest tests. 2024-01-29 19:18:43 +01:00
Kris Avi
b7154f811f Fixed #24128 -- Made admindocs TemplateDetailView respect template_loaders.
Co-Authored-By: Author: Alexander Lazarević <laza@e11bits.com>
2024-01-29 10:28:00 +01:00
David Smith
1df8983aa3 Refs #35058 -- Added support for measured geometries to GDAL LineString. 2024-01-29 08:44:42 +01:00
David Smith
2005530920 Refs #35058 -- Made centroid available on all geometry types.
Centroid is available on all geometry types since GDAL 1.8.0.
Previously it was restricted to Polygon.

https://gdal.org/doxygen/classOGRGeometry.html#a91787f669b2a148169667e270e7e40df
2024-01-28 14:40:19 +01:00
Mariusz Felisiak
305757aec1
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
2024-01-26 12:45:07 +01:00
David Smith
3f6d939c62 Refs #35058 -- Added support for measured geometries to GDAL Point.
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2024-01-25 08:59:16 +01:00
Baptiste Mispelon
a702a0773d
Added test for the sendtestemail command when no recipients are given. 2024-01-24 15:02:42 -03:00
Marijke Luttekes
e412d85b46
Fixed #35115 -- Made admin's footer render in <footer> tag. 2024-01-24 14:11:54 +01:00
David Smith
f4c5973464 Refs #35058 -- Deprecated OGRGeometry.coord_dim setter.
Reflecting a change in the underlying GDAL library (since GDAL 2.1)
using coord_dim to set a geometries dimensions is deprecated in favor
of set_3d().
2024-01-23 05:37:59 +01:00
David Smith
1c3a9b9f96 Added more WKT and WKB tests. 2024-01-22 10:40:32 +01:00
Mariusz Felisiak
4879907223
Fixed #35127 -- Made Model.full_clean() ignore GeneratedFields.
Thanks Claude Paroz for the report.

Regression in f333e3513e.
2024-01-19 08:55:50 +01:00
Mariusz Felisiak
51967b56c4
Corrected forms imports in forms_tests/tests/test_forms.py. 2024-01-18 12:20:19 +01:00
David Smith
cfacd69ab8 Refs #35058 -- Added is_3d and set_3d() to OGRGeometry. 2024-01-18 10:48:40 +01:00
Amir Karimi
27a3eee721 Fixed #31700 -- Made makemigrations command display meaningful symbols for each operation. 2024-01-17 14:00:02 +01:00
Alexis Athlani
c7e986fc9f Fixed #35117 -- Added support for the hectare unit in Area. 2024-01-16 20:31:46 +01:00
Simon Charette
0fcee1676c Fixed #35111 -- Fixed compilation of DateField __in/__range rhs on SQLite and MySQL.
Also removed tests that ensured that adapt_(date)timefield backend
operations where able to deal with expressions when it's not the case
for any other adapt methods.
2024-01-16 08:34:14 +01:00
Simon Charette
561f770415 Refs #22288 -- Corrected __range lookup test names. 2024-01-16 08:34:06 +01:00
Aivars Kalvans
f92641a636 Fixed #28344 -- Allowed customizing queryset in 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
2024-01-15 10:55:14 +01:00
Simon Charette
92d6cff6a2 Fixed #35028 -- Disabled server-side bindings for named cursors on psycopg >= 3.
While we provide a `cursor_factory` based on the value of the
`server_side_bindings` option to `psycopg.Connection` it is ignored by
the `cursor` method when `name` is specified for `QuerySet.iterator()`
usage and it causes the usage of `psycopg.ServerCursor` which performs
server-side bindings.

Since the ORM doesn't generates SQL that is suitable for server-side
bindings when dealing with parametrized expressions a specialized cursor
must be used to allow server-side cursors to be used with client-side
bindings.

Thanks Richard Ebeling for the report.

Thanks Florian Apolloner and Daniele Varrazzo for reviews.
2024-01-12 21:40:18 +01:00
nessita
02eaee1209
Added test ensuring that validate_password is used in AdminPasswordChangeForm.
Co-authored-by: Fabian Braun <fsbraun@gmx.de>
2024-01-12 17:27:55 -03:00
Florian Apolloner
6e520d9537 Avoided nested transactions in SkippingClassTestCase. 2024-01-12 09:57:52 +01:00
Alexander Lazarević
4787972c94 Refs #28404 -- Made displaying property values in admin respect non-None empty values. 2024-01-11 12:47:06 +01:00
Nick Pope
40b5b1596f Fixed #35100 -- Reworked GeoIP2 database initialization. 2024-01-11 12:01:35 +01:00
Nick Pope
f50184a84b
Fixed #35092 -- Exposed extra fields for GeoIP2.country() and GeoIP2.city() responses. 2024-01-10 12:09:44 +01:00
Alexander Lazarević
9b02ad91ea Fixed #28404 -- Made displaying values in admin respect Field's empty_values. 2024-01-10 08:34:25 +01:00
Tim Graham
ecd3071dac
Fixed #35097 -- Tested parse_datetime() with bare date.
Regression test for behavior change in
f35ab74752.
2024-01-09 14:08:03 -03:00
Alexander Lazarević
1b0a8991ae Refs #28404 -- Split test_null_display_for_field() test. 2024-01-09 11:44:16 +01:00
Sarah Boyce
a9094ec1f4 Fixed #35087 -- Reallowed filtering against foreign keys not listed in ModelAdmin.list_filters.
Regression in f80669d2f5.
2024-01-08 09:21:54 +01:00
Nick Pope
cc56c22a24
Fixed #35091 -- Allowed GeoIP2 querying using IPv4Address/IPv6Address. 2024-01-07 08:15:40 +01:00
David Smith
45f59d0eab Fixed #35086 -- Added support for BoundedCircle on Spatialite 5.1+.
Spatialite 5.1 added support for BoundingCircle
(GEOSMinimumBoundingCircle). GEOS 3.7 is required which is lower than
Django's currently supported minmum of 3.8.

https://groups.google.com/g/spatialite-users/c/hAJ2SgitN4M

https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html
2024-01-05 11:55:44 +01:00
Mariusz Felisiak
0c5456ef37
Used enterClassContext() where appropriate. 2024-01-04 05:55:29 +01:00
David Wobrock
8fb0be3500 Fixed #33277 -- Disallowed database connections in threads in SimpleTestCase. 2024-01-03 13:02:26 +01:00
Nick Pope
45f778eded Fixed #35075 -- Added deduplicate_items parameter to BTreeIndex. 2024-01-02 12:55:12 +01:00
Salvo Polizzi
3915d4c70d Fixed #35060 -- Deprecated passing positional arguments to Model.save()/asave(). 2024-01-02 08:42:33 +01:00
Nick Pope
c72001644f Updated DatabaseFeatures.bare_select_suffix on Oracle 23c.
https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/application-development.html#GUID-4EB70EB9-4EE3-4FE2-99C4-86F7AAC60F12
2024-01-01 10:59:16 +01:00
Mariusz Felisiak
d88ec42bd0
Used addCleanup() in tests where appropriate. 2023-12-31 10:01:31 +01:00
Paul Bailey
9d52e0720f
Fixed #35051 -- Prevented runserver from removing non-zero Content-Length for HEAD requests. 2023-12-31 08:32:37 +01:00
Nick Pope
94b6f101f7
Fixed #29049 -- Added slicing notation to F expressions.
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com>
Co-authored-by: Niclas Olofsson <n@niclasolofsson.se>
Co-authored-by: David Smith <smithdc@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
2023-12-30 08:24:30 +01:00
Simon Charette
e16d0c176e Fixed #35064 -- Fixed Window(order_by) crash with DecimalFields on SQLite.
This avoids cast of Window(order_by) for DecimalFields on SQLite.

This was achieved by piggy-backing ExpressionList which already
implements a specialized as_sqlite() method to override the inherited
behaviour of Func through SQLiteNumericMixin.

Refs #31723.

Thanks Quoates for the report.
2023-12-29 09:07:31 +01:00
Christian Clauss
ebf9320838
Removed unnecessary list() calls on sorted(). 2023-12-28 10:58:37 +01:00
Mariusz Felisiak
751d732a38
Fixed #35056 -- Fixed system check crash on reverse m2m relations with related_name in ModelAdmin.filter_horizontal/vertical.
Thanks Thomas Feldmann for the report.

Regression in 107865780a.
2023-12-27 20:36:22 +01:00
David Smith
21b0b23a67 Refs #35058 -- Made OGRGeomType aware of additional WKB geometry types.
This commit increases OGRGeomType's knowledge of WKB types and allows
for improved error messages when Django doesn't yet have a corresponding
class to wrap a given type.
2023-12-27 11:40:28 +01:00
Natalia
7c26dbf6ef Improved cache.tests.FileBasedCacheTests.test_touch to avoid flakiness due to slow file system access. 2023-12-27 06:05:33 +01:00
David Smith
2a2481f5a2
Refs #35058 -- Added __repr__() to OGRGeomType. 2023-12-26 21:23:33 +01:00
David Wobrock
14917c9ae2 Fixed #35050 -- Fixed prefixing field names in FilteredRelation().
Thanks Mark Zorn for the report.

Regression in 59f4754704.
2023-12-23 17:35:13 +01:00
David Wobrock
7045661069 Fixed #35022 -- Fixed RenameIndex() crash on unnamed indexes if exists unique constraint on the same fields. 2023-12-22 12:47:17 +01:00
Nicolas Lupien
2bf46c3825 Fixed #34658 -- Added SimpleTestCase.assertNotInHTML(). 2023-12-22 08:27:59 +01:00
David Smith
c709a748ce Fixed #35049 -- Dropped support for GDAL 2.4. 2023-12-20 21:44:11 +01:00
Claude Paroz
08306bad57 Fixed #34411 -- Updated GDAL API to handle vector DataSource's.
Co-authored-by: David Smith <smithdc@gmail.com>
2023-12-18 09:42:04 +01:00
Simon Charette
77278929c8 Fixed #35042 -- Fixed a count() crash on combined queries.
Regression in 59bea9efd2.

Thanks Marcin for the report.
2023-12-16 20:19:24 +01:00
Simon Charette
eea4f92f9a
Refs #34013 -- Registered instance lookups as documented in tests. 2023-12-16 20:05:36 +01:00
Eliana Rosselli
c83c639ba0 Fixed #34909 -- Associated links in admin navigation sidebar with row descriptions.
This adds aria-describedby attribute to the models' links in the admin
navigation sidebar.

Thanks Thibaud Colas for the review.

Co-authored-by: Dara Silvera <dsilvera@octobot.io>
2023-12-15 21:01:00 +01:00
Tobias Krönke
4b7fe146cc Refs #32503 -- Added assertion for effective default value when altering TextField to non-nullable with default. 2023-12-14 10:53:37 +01:00
Mariusz Felisiak
8fa7c2ae88
Improved test coverage for django.contrib.sessions.backends.base.SessionBase. 2023-12-13 12:51:58 +01:00
Nick Pope
a93375e8ab Fixed #34305 -- Changed GeoIP2 tests to use MaxMind test databases.
GEOIP_SETTINGS is removed from the global scope as this prevents
modifications to the settings using @override_settings in tests.

Additional improvements now that we have stable test databases include:

- Made testing more comprehensive and improved coverage
- Patched socket.gethostbyname() for whole test case
- Added testing of non-free GeoIP2 databases

Co-authored-by: Tom Forbes <tom@tomforb.es>
2023-12-12 09:58:26 +01:00
Simon Charette
b0ad41198b Fixed #34013 -- Added QuerySet.order_by() support for annotation transforms.
Thanks Eugene Morozov and Ben Nace for the reports.
2023-12-12 05:51:33 +01:00
Mariusz Felisiak
fcf95e5927
Fixed #35018 -- Fixed migrations crash on GeneratedField with BooleanField as output_field on Oracle < 23c.
Thanks Václav Řehák for the report.

Regression in f333e3513e.
2023-12-12 05:39:11 +01:00
Sarah Boyce
b287af5dc9 Fixed #35019 -- Fixed save() on models with both GeneratedFields and ForeignKeys.
Thanks Deb Kumar Das for the report.

Regression in f333e3513e.
2023-12-08 09:46:11 +01:00
Avaneesh Kumar
705b1702bd Fixed #34742 -- Made CommonMiddleware raise APPEND_SLASH RuntimeError on DELETE requests. 2023-12-08 05:56:36 +01:00
Mariusz Felisiak
5b3b791e90
Fixed #35024 -- Fixed model instance creation crash on GeneratedField.output_field with backend converters.
Regression in d9de74141e.

This is a long standing issue, however it caused a crash of
GeneratedFields for all output fields that have backend-specific
converters when the RETURNING clause is not supported
(MySQL and SQLite < 3.35).
That's why severity was exacerbated.
2023-12-07 20:50:18 +01:00
Nick Pope
af6e7e3de8 Refs #34986 -- Fixed backends.postgresql.test_server_side_cursors.ServerSideCursorsPostgres tests for PyPy. 2023-12-07 09:43:20 +01:00
Nick Pope
958a590e53 Refs #34986 -- Used non-binary build of psycopg for PyPy. 2023-12-07 09:21:37 +01:00
Sarah Boyce
f80669d2f5 Fixed #35020 -- Fixed ModelAdmin.lookup_allowed() for non-autofield primary keys.
Thanks Joshua Goodwin for the report.

Regression in 45ecd9acca.
2023-12-07 06:16:35 +01:00
Nick Pope
fb9216382a Refs #34986 -- Moved garbage_collect() helper to django.test.utils. 2023-12-06 09:26:11 +01:00
Nick Pope
1c3614e306 Refs #34986 -- Avoided implementation-specific unpickleable types.
The implementation of some core types differ between CPython and PyPy
and this may affect the way that pickling works such that errors are
raised in differing locations in the interpreter or not at all.

Use our own custom non-pickleable type instead to avoid these quirks.
2023-12-06 09:23:35 +01:00
Nick Pope
2c6e4a29b0 Fixed typo in tests/backends/postgresql/test_server_side_cursors.py. 2023-12-06 09:17:49 +01:00
Nick Pope
07f9f9960c Deprecated django.contrib.gis.geoip2.GeoIP2.open(). 2023-12-05 08:21:19 +01:00
yushanfans2233
14b0132e5e Fixed #34830 -- Added request to bad_request/csrf_failure view template contexts. 2023-12-04 10:52:06 +01:00
Peter Thomassen
54cb1a7e16 Fixed #35002 -- Made UniqueConstraints with fields respect nulls_distinct.
Regression in 595a2abb58.
2023-12-03 12:30:45 +01:00
Nick Pope
0f83133a35
Made GeoIP2.__del__() close all databases. 2023-12-01 13:55:45 +01:00
Nick Pope
b925fefd7d Deprecated django.contrib.gis.geoip2.GeoIP2.coords().
The `ordering` argument is undocumented and of limited use, so this is
effectively the same as `GeoIP2.lon_lat()`.
2023-12-01 08:38:42 +01:00
Sarah Boyce
af2fd36815 Refs #34995 -- Made Selenium tests more robust for admin_views and admin_widgets suites.
Depending on screen sizes, the selenium tests that would "click" or interact
with an element outside the scope of the visible window would produce test
failures (raising ElementNotInteractableException in CI runs).

This branch switches those to using ActionChains, which ensures that the click
(or other interaction) is performed only after successfully completing the
move to the relevant element.

Co-authored-by: Tom Carrick <tom@carrick.eu>
2023-11-30 10:39:10 -03:00
Mariusz Felisiak
37fc832a54
Fixed #35006 -- Fixed migrations crash when altering Meta.db_table_comment on SQLite.
Thanks Юрий for the report.

Regression in 78f163a4fb.
2023-11-30 10:10:27 +01:00
Nick Pope
06c5cb1284 Refs #34986 -- Removed redundant CustomChoicesTests.test_timezone_unsupported().
This test relied on the behavior of subclassing `datetime.timezone`
which is not permitted by the C-extension version of CPython's
`datetime` module. This restriction isn't enforced by the pure
Python version, nor by PyPy.

See https://github.com/python/cpython/issues/112451

It's not critical, and doesn't test any Django behavior, so just
remove it.
2023-11-29 21:12:53 +01:00
nessita
134cde8415
Removed hard-coded expected results in SeleniumTests.test_select_multiple test.
This ensures that both tests, test_select() and test_select_multiple(),
use analogous calculations for the expected amount of results, and for
the iteration when pressing "arrow down" and waiting for the ajax call
to complete.
2023-11-28 23:06:17 +01:00
Mariusz Felisiak
a4931cd75a
Refs #34380 -- Added FORMS_URLFIELD_ASSUME_HTTPS transitional setting.
This allows early adoption of the new default "https".
2023-11-28 20:04:21 +01:00
David Smith
76280b4f4d Refs #21442 -- Increased test coverage of requests. 2023-11-28 09:33:59 +01:00
Nick Pope
baf705f34a Refs #34986 -- Fixed some test assertions for PyPy.
These failures were due to minor inconsistencies or implementation
differences between CPython and PyPy.
2023-11-28 06:19:38 +01:00
Nick Pope
6089230d3e Refs #34986 -- Fixed mocking in utils_tests.test_http.HttpDateProcessingTests.test_parsing_rfc850.
Mocking in the `datetime` module can be tricky. In CPython the datetime
C module is used, but PyPy uses a pure Python implementation. This
caused issues with the prior approach to mocking `datetime.datetime`.

See https://docs.python.org/3/library/unittest.mock-examples.html#partial-mocking
2023-11-28 06:19:38 +01:00
Aman Pandey
0fcd72bc48 Fixed #34633 -- Made create() method of reverse many-to-one managers clear prefetch_related() cache. 2023-11-28 05:46:04 +01:00
Tom Carrick
729266c6f2 Fixed #34982 -- Fixed admin's read-only password widget and help texts alignment for tablet screen size.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2023-11-27 14:42:25 -03:00
Nick Pope
9baaf89eed Refs #34986 -- Added django.utils.version.PYPY. 2023-11-27 10:37:29 +01:00
Nathaniel Conroy
0257426fe1 Fixed #34992 -- Fixed DatabaseFeatures.allows_group_by_selected_pks on MariaDB with ONLY_FULL_GROUP_BY sql mode.
Regression in 041551d716.
2023-11-27 09:20:10 +01:00
Simon Charette
978680db22
Refs #34925 -- Avoided altering passed by reference refresh_from_db(fields).
Follow up to b0ec87b857.
2023-11-25 17:01:14 +01:00
trontelj
b0ec87b857 Fixed #34925 -- Prevented Model.refresh_from_db() from mutating list of fields. 2023-11-24 13:42:40 +01:00
Standa Opichal
1c6e8ec4ed Fixed #34968 -- Made multipart parsing of headers raise an error on too long headers.
This also allow customizing the maximum size of headers via
MAX_TOTAL_HEADER_SIZE.
2023-11-24 12:06:54 +01:00
Nick Pope
5e28cd3f2c
Fixed #34983 -- Deprecated django.utils.itercompat.is_iterable(). 2023-11-24 12:06:29 +01:00
Parth Verma
eabfa2d0e3
Fixed #34818 -- Prevented GenericIPAddressField from mutating error messages.
Co-authored-by: Parth Verma <parth.verma@gmail.com>
2023-11-24 05:46:17 +01:00
Prashant Pandey
a8adb6aa6c Fixed #26827 -- Improved ModelState error message when relations refer model classes. 2023-11-23 21:17:44 +01:00
Tom Carrick
a03593967f Fixed #14611 -- Added query_params argument to RequestFactory and Client classes. 2023-11-23 10:39:29 +01:00
Simon Charette
e76cc93b01
Fixed #34987 -- Fixed queryset crash when mixing aggregate and window annotations.
Regression in f387d024fc.

Just like `OrderByList` the `ExpressionList` expression used to wrap
`Window.partition_by` must implement `get_group_by_cols` to ensure the
necessary grouping when mixing window expressions with aggregate
annotations is performed against the partition members and not the
partition expression itself.

This is necessary because while `partition_by` is implemented as
a source expression of `Window` it's actually a fragment of the WINDOW
expression at the SQL level and thus it should result in a group by its
members and not the sum of them.

Thanks ElRoberto538 for the report.
2023-11-23 06:09:08 +01:00
Mariusz Felisiak
101a85a5a0
Fixed #34985 -- Fixed GeneratedFields.contribute_to_class() crash when apps are not populated.
Thanks Paolo Melchiorre for the report.

Regression in f333e3513e.
2023-11-22 13:41:32 +01:00
Sarah Boyce
828082dad9 Fixed #34984 -- Skipped GeneratedFields when remaking tables on SQLite.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.t

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
2023-11-22 12:29:14 +01:00
Mariusz Felisiak
584fc49ac4
Refs #34900 -- Skipped Selenium requirement on daily builds for Python 3.13.
Selenium required trio and trio required cffi on Windows.
2023-11-22 09:51:22 +01:00
Michał Górny
09b4a4e2c1 Fixed runtests.py crash on PyPy.
The gc.set_threshold() call was made conditional to non-PyPy
implementations. The method is not available in PyPy3, and GC is much
less aggressive there, so the adjustment probably is not necessary.
2023-11-21 08:07:16 +01:00
Mariusz Felisiak
6af83d2ee6
Refs #34900 -- Skipped argon2-cffi requirement on daily builds for Python 3.13. 2023-11-21 07:54:18 +01:00
Mariusz Felisiak
00a950f923
Refs #34900 -- Added Python 3.13 to daily builds. 2023-11-20 19:52:56 +01:00
Mariusz Felisiak
19c4052f98
Refs #34118 -- Used Python 3.12 for GitHub actions. 2023-11-18 16:58:25 +01:00
Simon Charette
15cb3c262a Refs #34975 -- Complemented rhs filtering aggregations for __in lookup.
While this isn't a regression it's clear that similar logic should be
applied when dealing with lists of expressions passed as a lookup value.
2023-11-18 15:40:52 +01:00
Simon Charette
7530cf3900 Fixed #34975 -- Fixed crash of conditional aggregate() over aggregations.
Adjustments made to solve_lookup_type to defer the resolving of
references for summarized aggregates failed to account for similar
requirements for lookup values which can also reference annotations
through Aggregate.filter.

Regression in b181cae2e3.

Refs #25307.

Thanks Sergey Nesterenko for the report.
2023-11-18 15:38:04 +01:00
David Smith
eec7e9ba89 Refs #32819 -- Established relationship between form fieldsets and their help text.
This adds aria-describedby for widgets rendered in a fieldset such as
radios. aria-describedby for these widgets is added to the <fieldset>
element rather than each <input>.
2023-11-17 08:12:36 +01:00
David Smith
557fa51837 Refs #32819 -- Added aria-describedby test for widgets with custom id. 2023-11-17 05:43:33 +01:00
Mariusz Felisiak
c705625ebf Refs #34944 -- Propagated system checks for GeneratedField.output_field. 2023-11-14 20:22:07 +01:00
Mariusz Felisiak
5875f03ce6 Fixed #34944 -- Made GeneratedField.output_field required.
Regression in f333e3513e.
2023-11-14 20:22:07 +01:00
Mariusz Felisiak
de4884b114 Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value()."
This reverts commit 8b1acc0440.
2023-11-14 15:45:43 +01:00
Simon Charette
6364b6ee10 Fixed #34955 -- Made Concat() use || operator on PostgreSQL.
This also avoids casting string based expressions in Concat() on
PostgreSQL.
2023-11-14 10:56:20 +01:00
jedidiah
bdf30b952c Fixed #34919 -- Added scope attribute to admindocs model templates. 2023-11-14 05:34:56 +01:00
Andrew Cordery
ad41f1c53a Fixed #34952 -- Copied dir list when processing locale folders to avoid missing entries during os.walk traversal.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2023-11-13 14:03:48 -03:00
David Sanders
b863c5ffde Fixed #34967 -- Fixed queryset crash when grouping by constants on SQLite < 3.39.
On SQLite < 3.39, this forces a GROUP BY clause with a HAVING clause
when no grouping is specified.

Co-authored-by: Simon Charette <charette.s@gmail.com>
2023-11-13 12:01:40 +01:00
nessita
1b56b24f81
Fixed #34958 -- Fixed isolation of messages_tests.tests.TestLevelTags.test_lazy. 2023-11-13 09:35:57 +01:00
Adam Johnson
f7389c4b07 Fixed #34457 -- Restored output for makemigrations --check.
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2023-11-09 10:03:19 -03:00
Simon Charette
8b1acc0440 Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value().
This should allow smarter output_field inferring in functions dealing
with text expressions.

Regression in f333e3513e.
2023-11-08 15:48:15 +03:00
Natalia
5f2f12f61c Reverted "Fixed #34830 -- Added request to csrf_failure view's template context."
This reverts commit 535f7b5c6c.
2023-11-08 08:50:55 -03:00
Prakhar
535f7b5c6c Fixed #34830 -- Added request to csrf_failure view's template context.
Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
2023-11-07 09:09:39 -03:00
Simon Charette
8a28e983df
Fixed #34946 -- Preserved db_default on combined default field addition.
Regression in 7414704e88.
2023-11-07 13:32:34 +03:00
David Sanders
797957fb48 Fixed #34936 -- Fixed migration crash for DecimalField with db_default on SQLite.
CAST() must be wrapped in parentheses to be recognized as an expression on SQLite.

Regression in 7414704e88.
2023-11-02 17:57:39 +01:00
David Sanders
1944f490f9 Refs #34936 -- Added test for altering DecimalField with db_default to non-nullable. 2023-11-02 17:57:34 +01:00
Tim Graham
208870b612 Refs #31300 -- Allowed testing GeneratedField without collation.
CockroachDB and Snowflake don't support it.
2023-11-02 13:58:46 +01:00
Antoine Cheneau
65c283be16 Fixed #34927 -- Fixed admin system check for inlines with foreign keys to proxy models.
Follow up to 0e8be73812.
2023-11-02 10:42:20 +01:00
Mariusz Felisiak
05ba4130ee Fixed CVE-2023-46695 -- Fixed potential DoS in UsernameField on Windows.
Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report.
2023-11-01 06:10:30 +01:00
Akash Kumar Sen
40b3975e7d Fixed #34462 -- Made admin log actions in bulk.
This also deprecates ModelAdmin.log_deletion() and
LogEntryManager.log_action().
2023-10-31 18:06:44 +01:00
Akash Kumar Sen
45e0c5892f Refs #34462 -- Moved ModelAdmin.log_deletion() test to a separate test case. 2023-10-31 10:36:23 +01:00
Ben Cail
523fed1d2f Fixed #32106 -- Preserved HTTP_HOST in test Client when following redirects.
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
2023-10-31 05:29:43 +01:00
Sarah Boyce
e4d012ca05 Refs #29850 -- Added exclusion support to window frames. 2023-10-30 12:04:55 +01:00
Tom Carrick
34b411762b Fixed #34932 -- Restored varchar_pattern_ops/text_pattern_ops index creation when deterministic collaction is set.
Regression in f3f9d03edf (4.2) and
8ed25d65ea (5.0).
2023-10-30 07:37:40 +01:00
Sarah Boyce
6375cee490 Refs #29850 -- Added RowRange support for positive integer start and negative integer end. 2023-10-28 15:16:07 +02:00
ksg
a6c7db1d1d
Fixed #34943 -- Made EmailValidator.__eq__() ignore domain_allowlist ordering.
Signed-off-by: ksg97031 <ksg97031@gmail.com>
2023-10-28 14:35:25 +02:00
Mariusz Felisiak
cf57e220a9
Fixed isolation of DatabaseWrapperLoggingTests.test_commit_debug_log(). 2023-10-27 09:05:09 +02:00
Tom Carrick
e67d3580ed Fixed #10941 -- Added {% query_string %} template tag. 2023-10-26 09:57:21 +02:00
sindre
64060d1c17 Fixed #34904 -- Prevented mutating sent emails from outbox in locmem email backend. 2023-10-25 08:52:31 +02:00
Mariusz Felisiak
311718feb5 Fixed #34923 -- Avoided initializing LEVEL_TAGS when importing django.contrib.messages.
Regression in b7fe36ad37.

Thanks James Gillard for the report.
2023-10-24 14:09:31 -03:00
ksg97031
d22ba07630 Fixed #34920 -- Made FileExtensionValidator.__eq__() ignore allowed_extensions ordering. 2023-10-24 05:31:11 +02:00
Nick Pope
171f91d9ef Fixed #34899 -- Added blank choice to forms' callable choices lazily. 2023-10-23 13:44:23 -03:00
Nick Pope
74afcee234 Refs #34899 -- Extracted Field.flatchoices to flatten_choices helper function.
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
2023-10-23 13:44:23 -03:00
Nick Pope
07fa79ef2b Refs #31262 -- Added __eq__() and __getitem__() to BaseChoiceIterator.
This makes it easier to work with lazy iterators used for callables,
etc. when extracting items or comparing to lists, e.g. during testing.

Also added `BaseChoiceIterator.__iter__()` to make it clear that
subclasses must implement this and added `__all__` to the module.

Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
2023-10-23 13:44:16 -03:00
David Sanders
b5311ee232 Fixed #34921 -- Fixed crash of warning for unbound naive datetimes. 2023-10-22 14:26:38 +02:00
laserhyena
21382e2743 Fixed #34911 -- Corrected HTML heading levels on admindocs' main page. 2023-10-20 05:44:55 +02:00
ontowhee
89d2ae257b
Fixed #34905 -- Corrected admin's main content element rendered in <main> tag.
Regression in 91e617c743.

Thanks Tom Carrick for the report.
2023-10-19 17:25:50 +02:00
Sarah Boyce
71a813a72c
Made SeleniumTests.test_select_multiple less flaky by improving Selenium waits. 2023-10-19 16:01:52 +02:00
Sarah Boyce
be56c982c0 Refs #34043 -- Added --screenshots option to runtests.py and selenium tests. 2023-10-18 06:14:40 +02:00
Sarah Boyce
f6629ee2c9 Refs #34043 -- Added context managers to SeleniumTestCase for changing window size. 2023-10-16 10:36:26 +02:00
Mariusz Felisiak
20b7aac7ca
Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.1+.
Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

https://github.com/python/cpython/issues/110890#issuecomment-1763458686
https://github.com/python/cpython/pull/106588
2023-10-16 06:27:27 +02:00
Simon Charette
3b4a571275 Fixed #34798 -- Fixed QuerySet.aggregate() crash when referencing expressions containing subqueries.
Regression in 59bea9efd2,
complements e5c844d6f2.

Refs #28477, #34551.

Thanks Haldun Komsuoglu for the report.
2023-10-16 05:37:30 +02:00