Commit Graph

11085 Commits

Author SHA1 Message Date
Alix 26a413507a Fixed #6933 -- Added support for searching against quoted phrases in ModelAdmin.search_fields. 2020-06-18 20:17:20 +02:00
Tom Forbes 8a902b7ee6
Fixed #31716 -- Fixed detection of console scripts in autoreloader on Windows. 2020-06-18 13:04:10 +02:00
David Smith 10df5b7177
Refs #31670 -- Removed whitelist/blacklist terminology in docs and comments. 2020-06-17 13:15:56 +02:00
Hasan Ramezani 47651eadb8 Fixed #30583 -- Fixed handling JSONFields in XML serializer.
Co-authored-by: Chason Chaffin <chason@gmail.com>
2020-06-17 11:12:18 +02:00
Mariusz Felisiak 82da72b748
Refs #28077 -- Added opclasses to Index.__repr__().
This also removes unnecessary commas between attributes.
2020-06-17 10:32:43 +02:00
Florian Apolloner 1621f06051 Fixed #30472 -- Made Argon2PasswordHasher use Argon2id. 2020-06-17 08:10:41 +02:00
Florian Apolloner ee49cf4f35 Added test for old Argon2i hashes with version attribute. 2020-06-17 08:10:41 +02:00
Mariusz Felisiak 78c811334c
Refs #30190 -- Minor edits to JSONL serializer.
Follow up to e29637681b.
2020-06-17 07:59:40 +02:00
Mariusz Felisiak e36028fb9c
Reverted "Pinned asgiref == 3.2.7 in test requirements."
This reverts commit dcb4d79ef7.
2020-06-17 07:08:51 +02:00
Ali Vakilzade e29637681b
Fixed #30190 -- Added JSONL serializer. 2020-06-16 16:51:58 +02:00
Simon Charette ea3beb4f5a Refs #30446 -- Defined default output_field of text database functions.
This prevented the default behavior of
BaseExpression._resolve_output_field from error'ing out when such
functions accepted both expressions from mixed types
(e.g. SubStr(CharField, IntegerField, IntegerField)).
2020-06-16 10:08:02 +02:00
Hannes Ljungberg 0d6d4e78b1 Fixed #31709 -- Added support for opclasses in ExclusionConstraint. 2020-06-16 08:16:14 +02:00
Mariusz Felisiak dcb4d79ef7
Pinned asgiref == 3.2.7 in test requirements. 2020-06-16 07:54:41 +02:00
Hannes Ljungberg 7edc6e53a7 Fixed #31702 -- Added support for PostgreSQL opclasses in UniqueConstraint. 2020-06-16 07:19:00 +02:00
John Parton a8473b4d34 Fixed #31691 -- Added ordering support to JSONBAgg. 2020-06-13 00:06:29 +02:00
Hannes Ljungberg e0cdd0fcf5 Fixed #31649 -- Added support for covering exclusion constraints on PostgreSQL 12+. 2020-06-12 23:23:21 +02:00
Hasan Ramezani 9e8edc1e55 Fixed #31491 -- Allowed 'password' option in DATABASES['OPTIONS'] on MySQL. 2020-06-12 12:07:43 +02:00
Chinmoy Chakraborty 2928019e0c Fixed #31645 -- Enhanced the migration warning for migrate commmand.
Added the list of apps with changes not reflected in migrations.
2020-06-12 10:26:06 +02:00
Mariusz Felisiak aeb8996a67 Fixed #31659 -- Made ExpressionWrapper preserve output_field for combined expressions.
Regression in df32fd42b8.

Thanks Simon Charette for the review.
2020-06-12 07:20:06 +02:00
Adam Johnson 5776a1660e Fixed #31667 -- Made __in lookup ignore None values. 2020-06-11 12:12:26 +02:00
Michael Brown 36db4dd937 Fixed #28132 -- Made MultiPartParser ignore filenames with trailing slash. 2020-06-11 08:46:59 +02:00
Hasan Ramezani 037a624120 Fixed #31657 -- Fixed ordering by attnames of self-referential ForeignKeys. 2020-06-10 11:14:26 +02:00
Hasan Ramezani c1f7de8acc Refs #31657 -- Added test for ordering by self-referential ForeignKeys. 2020-06-10 11:11:20 +02:00
Hasan Ramezani a59de6e89e Fixed #31675 -- Added warning to ExceptionReporter when exception chain has a cycle. 2020-06-10 09:23:33 +02:00
Joshua Massover 92309e53d9 Fixed #31594 -- Added ASGIStaticFilesHandler.get_response_async(). 2020-06-08 12:52:26 +02:00
Nicolas Baccelli b38d44229f Fixed #31664 -- Reallowed using non-expressions having filterable attribute as rhs in queryset filters.
Regression in 4edad1ddf6.
2020-06-08 08:17:23 +02:00
Mariusz Felisiak 78ad4b4b02
Fixed #31660 -- Fixed queryset crash when grouping by m2o relation.
Regression in 3a941230c8.

Thanks Tomasz Szymański for the report.
2020-06-08 07:21:54 +02:00
davidchorpash 07506a6114 Fixed #31661 -- Removed period in makemigrations history check warning. 2020-06-08 06:46:23 +02:00
Sasha Pachev 38a21f2d9e
Fixed #31663 -- Made DecimalField.to_python() handle non-numeric invalid values. 2020-06-05 21:13:36 +02:00
David Smith 433dd737f9 Fixed #20347 -- Allowed customizing the maximum number of instantiated forms in formsets.
Co-authored-by: ethurgood <ethurgood@gmail.com>
2020-06-05 12:01:32 +02:00
David Smith b5aa9cb20f Refs #20347 -- Added test for formset_factory()'s absolute_max default.
Co-authored-by: ethurgood <ethurgood@gmail.com>
2020-06-05 10:00:25 +02:00
Mariusz Felisiak 926148ef01
Fixed #31654 -- Fixed cache key validation messages. 2020-06-05 07:21:52 +02:00
Mariusz Felisiak f83b44075d Refs #30913 -- Added system checks for covering indexes and unique constraints support. 2020-06-04 12:26:25 +02:00
Hannes Ljungberg 8c7992f658 Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+. 2020-06-04 12:26:22 +02:00
Jon Dufresne f47d5aac62
Refs #27804 -- Used subTest() in tests.utils_tests.test_text. 2020-06-04 11:16:21 +02:00
Claude Paroz 9e57b1efb5 Fixed #30134 -- Ensured unlocalized numbers are string representation in templates. 2020-06-04 10:34:54 +02:00
Claude Paroz 51250d2f12 Refs #30134 -- Added test for {% localize off %} tag with format settings. 2020-06-04 10:34:54 +02:00
Tim Graham a7b4a04d6c Refs #31630 -- Added CharField and IntegerField to DatabaseFeatures.introspected_field_types.
CockroachDB introspects CharField as TextField and IntegerField as
BigIntegerField.
2020-06-04 08:46:06 +02:00
Tim Graham e24b63fe85 Refs #31630 -- Removed DatabaseFeatures.can_introspect_autofield. 2020-06-04 08:27:46 +02:00
Hasan Ramezani e198beadad Fixed #31630 -- Replaced introspection features with DatabaseFeatures.introspected_field_types. 2020-06-04 08:27:42 +02:00
David Smith dbdc192ca3 Preferred usage of among/while to amongst/whilst. 2020-06-03 21:02:48 +02:00
Mariusz Felisiak 229c9c6653 Refs CVE-2020-13254 -- Fixed cache.tests when KEY_PREFIX is defined.
Follow up to 2c82414914.
2020-06-03 13:00:37 +02:00
Dan Palmer 2c82414914 Fixed CVE-2020-13254 -- Enforced cache key validation in memcached backends. 2020-06-03 09:24:26 +02:00
Jon Dufresne 2dd4d110c1 Fixed CVE-2020-13596 -- Fixed potential XSS in admin ForeignKeyRawIdWidget. 2020-06-03 09:23:00 +02:00
Thodoris Sotiropoulos df32fd42b8 Fixed #31651 -- Made ExpressionWrapper use grouping columns from wrapped expression. 2020-06-03 07:29:41 +02:00
Adam Johnson 22a59c01c0 Refs #31615 -- Added EXISTS clauses to extension operations. 2020-06-03 07:02:48 +02:00
Carles Pina e46c2326c8 Fixed #31536 -- Fixed rendering of disabled AdminFileWidget and ClearableFileInput. 2020-06-01 12:25:25 +02:00
René Fleschenberg 578b3046e3 Reverted "Refs #23919 -- Removed obsolete __init__.py files in management command directories."
This reverts commit ccc25bfe4f.

https://groups.google.com/d/topic/django-developers/GVHMH2ciAnk/discussion
2020-06-01 10:55:41 +02:00
Carlton Gibson dd1ca50b09 Fixed #31570 -- Corrected translation loading for apps providing territorial language variants with different plural equations.
Regression in e3e48b0012.

Thanks to Shai Berger for report, reproduce and suggested fix.
2020-06-01 08:38:54 +02:00
David Smith 0382ecfe02 Fixed #28694 -- Made django.utils.text.slugify() strip dashes and underscores. 2020-05-29 06:47:51 +02:00
David Smith dde05e192c Added more tests for slugify(). 2020-05-29 06:28:57 +02:00
Adam Johnson fa58450a9a Fixed #31468 -- Allowed specifying migration filename in Operation.
This adds also suggested filename for many built-in operations.
2020-05-28 11:42:53 +02:00
Adam Johnson 5bd585a82d Refs #31468 -- Added tests for MigrationAutodetector.suggest_name(). 2020-05-28 11:24:58 +02:00
Tom Carrick 780473d756 Refs #31034 -- Improved accessibility of admin navigation sidebar. 2020-05-28 10:16:20 +02:00
Mariusz Felisiak 42de52affe
Fixed isolation of test_migrate_fake_initial. 2020-05-28 09:32:43 +02:00
Scott Cranfill 62f1655a64 Fixed #11157 -- Stopped removing stop words in admin's prepopulated_fields.
Co-Authored-By: Andy Chosak <andy@chosak.org>
2020-05-27 12:32:56 +02:00
Frantisek Holop d693a086de Fixed #31615 -- Made migrations skip extension operations if not needed.
- Don't try to create an existing extension.
- Don't try to drop a nonexistent extension.
2020-05-27 10:48:44 +02:00
Frantisek Holop 73216aaaa9 Used not installed extension in CreateExtension() tests.
uuid-ossp was already installed.
2020-05-27 10:46:22 +02:00
Ahmad A. Hussein 7c947f0f5a Fixed #31494 -- Preserved query strings when following HTTP 307/308 redirects in test client. 2020-05-27 10:36:52 +02:00
Ahmad A. Hussein 6425fd3124 Refs #31494 -- Added test for query strings for GET/HEAD requests when following HTTP 307/308 redirects in test client. 2020-05-27 10:36:52 +02:00
Mariusz Felisiak f4bab0982a Refs #31614 -- Added test for ordering by OrderBy() of combined queryset with not selected columns. 2020-05-27 09:03:53 +02:00
Ryan Heard 587b179d41 Fixed #31606 -- Allowed using condition with lookups in When() expression. 2020-05-27 07:32:23 +02:00
Laurent Tramoy 2aac176e86 Fixed #31614 -- Fixed aliases ordering by OrderBy() expressions of combined queryset. 2020-05-26 21:14:45 +02:00
Laurent Tramoy 51ad767d0b Refs #31614 -- Added test for aliases ordering on combined querysets. 2020-05-26 21:14:40 +02:00
Laurent Tramoy 50f71ccb36 Used operator.attrgetter() in test_qs_combinators. 2020-05-26 21:14:40 +02:00
Nan Liu 33c365781a Fixed #31416 -- Made autodetector find dependencies for MTI model creation on base fields removal.
Removing a base field must take place before adding a new inherited
model that has a field with the same name.
2020-05-26 07:26:07 +02:00
Hasan Ramezani 18759b2209 Fixed #31616 -- Added hint about middleware ordering for SessionMiddleware admin check. 2020-05-25 21:14:32 +02:00
Claude Paroz adf58311b8 Fixed #29078 -- Made serializers respect prefetch_related() for m2m fields. 2020-05-25 10:45:16 +02:00
Claude Paroz b547c42661 Improved HTTPSitemapTests.test_localized_priority.
Override setting instead of skipping.
Use translation override context manager to avoid language leaking.
2020-05-25 09:07:50 +02:00
Simon Charette 972000420e Fixed #31624 -- Avoided subquery usage on QuerySet.all().delete().
Thanks Adam Johnson for the report.

Regression in 7acef095d7.
2020-05-25 08:14:49 +02:00
Jon Dufresne dfb9ae1d23 Refs #30400 -- Improved typography in admin_doc/missing_docutils.html. 2020-05-23 12:02:10 +02:00
Hasan Ramezani c60524c658 Fixed #31546 -- Allowed specifying list of tags in Command.requires_system_checks. 2020-05-21 12:34:54 +02:00
Manuel Weitzman a4e6030904 Fixed #30375 -- Added FOR NO KEY UPDATE support to QuerySet.select_for_update() on PostgreSQL. 2020-05-21 10:51:10 +02:00
Jon Dufresne 81d69568a6 Made test_once a keyword argument in template_tests.utils.setup().
Replaces the kwargs.get(...) pattern. Helps avoid typos by providing a
better error message in case of misuse.
2020-05-21 08:09:19 +02:00
Fran Hrzenjak 4484bc1b2f Fixed #31597, #31603 -- Corrected admin clear all filters link behavior.
- Show "Clear all filters" only when any filter is selected.
- Preserve query string not related with filters.

Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2020-05-20 21:08:47 +02:00
Hasan Ramezani 3c7bf39e23 Fixed #31410 -- Added system checks for invalid model field names in UniqueConstraint. 2020-05-20 10:56:55 +02:00
David Smith e875fac886
Removed unused variable in test_datetimefield_clean_input_formats. 2020-05-20 06:02:28 +02:00
Mariusz Felisiak a125da6a7c Fixed #31607 -- Fixed evaluated Subquery equality.
Regression in 691def10a0.
2020-05-19 22:44:57 +02:00
Mariusz Felisiak b739f2e91d Refs #30727 -- Added tests for Subquery with queryset in kwargs pickle without evaluating it. 2020-05-19 22:44:57 +02:00
Mariusz Felisiak 20a8a443f0
Fixed #31578 -- Dropped support for MySQL 5.6. 2020-05-19 10:56:39 +02:00
wtkm11 9756c33429 Fixed #31504 -- Allowed calling makemigrations without an active database connection. 2020-05-19 10:24:23 +02:00
Hannes Ljungberg 952afc166c Fixed #31601 -- Fixed SearchHeadlineTests on PostgresSQL 9.6.18+, 10.13+, 11.8+, and 12.3+. 2020-05-19 07:46:22 +02:00
Jon Dufresne 3b1cb78063
Used assertIs(…, True) in model_forms.tests.ValidationTest. 2020-05-18 09:25:26 +02:00
Jon Dufresne 7070d46114 Updated docutils link to HTTPS and new location. 2020-05-18 08:45:31 +02:00
Tim Graham f59a2b7306
Refs #12990 -- Added DatabaseFeatures.has_json_operators.
CockroachDB also has them.
2020-05-18 08:12:20 +02:00
Simon Charette 94f63b926f Refs #31395 -- Relied on setUpTestData() test data isolation in various tests. 2020-05-15 20:22:56 +02:00
Simon Charette 3cf80d3fcf Fixed #31395 -- Made setUpTestData enforce in-memory data isolation.
Since it's introduction in Django 1.8 setUpTestData has been suffering
from a documented but confusing caveat due to its sharing of attributes
assigned during its execution with all test instances.

By keeping track of class attributes assigned during the setUpTestData
phase its possible to ensure only deep copies are provided to test
instances on attribute retreival and prevent manual setUp gymnastic to
work around the previous lack of in-memory data isolation.

Thanks Adam Johnson for the extensive review.
2020-05-15 20:22:52 +02:00
Simon Charette 1dd96f731d Refs #13227 -- Adjusted a test to avoid making a shared test model unpickable.
This allowed the Note model to be used in setUpTestData() which requires
assigned model instances to be copy.deepcopy()'able.
2020-05-15 20:22:51 +02:00
Paolo Melchiorre 0e3b0da2e3 Fixed #31552 -- Added support for LZMA and XZ fixtures to loaddata. 2020-05-15 11:30:28 +02:00
François Freitag 2e48cf6bd9 Fixed fixtures loading isolation in tests.
fixture1.json and fixture2.json exist in both "fixtures" and
"fixtures_model_package". Both apps are listed in "INSTALLED_APPS". The
loaddata management command loads from installed apps, thus loads both
fixtures when a test runs loaddata with any of these fixtures.
2020-05-15 09:14:05 +02:00
kjpc-tech 099bce1bf0 Fixed #31590 -- Fixed ModelAdmin.date_hierarchy crash with an empty QuerySet.
Regression in 55cdf6c52d.
2020-05-15 06:35:10 +02:00
Jon Dufresne 81ffedaacc Fixed #31524 -- Removed minified static assets from the admin. 2020-05-14 16:07:56 +02:00
Carlton Gibson 6c19c2ca51 Corrected indentation in test case. 2020-05-14 15:32:36 +02:00
Jon Dufresne 129193328e Added Selenium test coverage for actions.js. 2020-05-14 15:32:36 +02:00
Mariusz Felisiak 3a941230c8
Fixed #31584 -- Fixed crash when chaining values()/values_list() after Exists() annotation and aggregation on Oracle.
Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in
the GROUP BY clause.

Regression in efa1908f66.
2020-05-14 15:07:08 +02:00
David Smith 03537e2458
Completed lorem tag test coverage. 2020-05-14 12:36:38 +02:00
Jon Dufresne d522b51c40 Fixed #31575 -- Added system check for admin sidebar request context processor dependency.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2020-05-14 11:00:51 +02:00
Simon Charette adfbf653dc Fixed #31568 -- Fixed alias reference when aggregating over multiple subqueries.
691def10a0 made all Subquery() instances
equal to each other which broke aggregation subquery pushdown which
relied on object equality to determine which alias it should select.

Subquery.__eq__() will be fixed in an another commit but
Query.rewrite_cols() should haved used object identity from the start.

Refs #30727, #30188.

Thanks Makina Corpus for the report.
2020-05-14 09:31:15 +02:00
Simon Charette 42c08ee465 Fixed #31566 -- Fixed aliases crash when chaining values()/values_list() after annotate() with aggregations and subqueries.
Subquery annotation references must be resolved if they are excluded
from the GROUP BY clause by a following .values() call.

Regression in fb3f034f1c.

Thanks Makina Corpus for the report.
2020-05-14 08:16:16 +02:00
Mariusz Felisiak e536fa5ce1
Fixed #31579 -- Dropped support for PostgreSQL 9.5 and PostGIS 2.2. 2020-05-14 06:33:00 +02:00