1
0
mirror of https://github.com/django/django.git synced 2025-03-14 11:20:46 +00:00

10934 Commits

Author SHA1 Message Date
Tim Graham
5480fab290 [3.1.x] Refs #12990 -- Added DatabaseFeatures.has_json_operators.
CockroachDB also has them.
Backport of f59a2b730685fc62c5cb44101f54faf8921d9bc7 from master
2020-05-18 08:12:57 +02:00
kjpc-tech
ef19aec2ca [3.1.x] Fixed #31590 -- Fixed ModelAdmin.date_hierarchy crash with an empty QuerySet.
Regression in 55cdf6c52db07f29128741b8734a523ed042e465.

Backport of 099bce1bf0b9802b7159beb9260b9b9e344bf497 from master
2020-05-15 07:07:49 +02:00
Mariusz Felisiak
b46b0f80e8 [3.1.x] 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 efa1908f662c19038a944129c81462485c4a9fe8.
Backport of 3a941230c85b2702a5e1cd97e17251ce21057efa from master
2020-05-14 15:10:28 +02:00
Jon Dufresne
1c2d0fdf3e [3.1.x] Fixed #31575 -- Added system check for admin sidebar request context processor dependency.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>

Backport of d522b51c401429c169d88742178a9b3777903d9e from master
2020-05-14 11:01:22 +02:00
Simon Charette
3913acdb29 [3.1.x] Fixed #31568 -- Fixed alias reference when aggregating over multiple subqueries.
691def10a0197d83d2d108bd9043b0916d0f09b4 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.

Backport of adfbf653dc1c1d0e0dacc4ed46602d22ba28b004 from master
2020-05-14 10:26:05 +02:00
Simon Charette
8cb87a3f7c [3.1.x] 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 fb3f034f1c63160c0ff13c609acd01c18be12f80.

Thanks Makina Corpus for the report.

Backport of 42c08ee46539ef44f8658ebb1cbefb408e0d03fe from master
2020-05-14 08:39:21 +02:00
Mariusz Felisiak
e078870757 [3.1.x] Fixed #31576 -- Fixed selenium tests with headless mode.
Horizontal scrollbar doesn't appear with the headless mode on small
windows, that's why window.scrollTo() is not an option for these
tests.

Tests changed after adding a navigation sidebar in
46fe506445666d8097945f0c1e8be11cfd644b28.
Backport of 18eb852874a073001cb509f64002b6d82bdc760b from master
2020-05-13 15:46:56 +02:00
Claude Paroz
58f1b07e49 Fixed #30678 -- Added support for GDAL 3. 2020-05-12 09:06:06 +02:00
Mariusz Felisiak
0668164b4a
Fixed E128, E741 flake8 warnings. 2020-05-12 08:52:23 +02:00
Tom Carrick
d24ba1be7a Fixed #31034 -- Added a navigation sidebar to the admin.
Co-authored-by: elky <elky@users.noreply.github.com>
Co-authored-by: Goetz <goetz.buerkle@gmail.com>
2020-05-11 18:16:38 +02:00
Jon Dufresne
d6aff369ad Refs #30116 -- Simplified regex match group access with Match.__getitem__().
The method has been available since Python 3.6. The shorter syntax is
also marginally faster.
2020-05-11 12:01:28 +02:00
Adam Johnson
a8b2db1cae Optimized Model and QuerySet pickling version comparison. 2020-05-11 09:50:11 +02:00
Jon Dufresne
72a170b4c3 Fixed #25236 -- Deprecated {% ifequal %} and {% ifnotequal %} template tags.
The {% if %} tag provides all features of these tags.

Since Django 1.2 (May 17, 2010), the docs have hinted that
{% ifequal %} and {% ifnotequal %} will be deprecated in a future
Django version. Time to make it official.
2020-05-11 09:07:33 +02:00
Jon Dufresne
d8cb8fdf40 Switched unittest.TestCase to SimpleTestCase in template_tests/test_nodelist.py. 2020-05-11 07:56:11 +02:00
Yash Saini
ccb1cfb64e Fixed #31548 -- Fixed URLValidator crash on non-strings. 2020-05-08 20:53:05 +02:00
Yash Saini
bda6ade7b7 Added URLValidator test for missing scheme. 2020-05-08 20:50:25 +02:00
Hasan Ramezani
87faeee4e0 Fixed #31528 -- Made collectstatic management command run staticfiles checks. 2020-05-08 12:47:57 +02:00
François Freitag
01f8d19ef9 Fixed tests isolation in logging_tests.
The SetupConfigureLogging test case does not restore the logging config
after its execution. It leaves the logger django.request with an empty
handlers array.

This also removes the last use of LOGGING_CONFIG, introduced in
43503b093a35ca4707c16d865f10929960bfa0b8.
2020-05-08 10:49:34 +02:00
dbxnr
fc0f7f6c15 Fixed #31157 -- Fixed displaying read-only JSONField values in admin. 2020-05-08 09:44:42 +02:00
dbxnr
675ce4dd35 Refs #31157 -- Added tests for display_for_field() with empty JSONField. 2020-05-08 09:37:49 +02:00
Paolo Melchiorre
2e0f04507b Added tests for loaddata with gzip/bzip2 compressed fixtures.
Co-authored-by: Adam Johnson <me@adamj.eu>
2020-05-08 08:16:50 +02:00
sage
6789ded0a6 Fixed #12990, Refs #27694 -- Added JSONField model field.
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael
Michel for mentoring this Google Summer of Code 2019 project and
everyone else who helped with the patch.

Special thanks to Mads Jensen, Nick Pope, and Simon Charette for
extensive reviews.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-05-08 07:23:31 +02:00
Mariusz Felisiak
f97f71f592 Refs #12990 -- Bumped mysqlclient requirement to >= 1.4.0.
MySQLdb.constants.FIELD_TYPE.JSON was added in mysqlclient 1.4.0rc2.
2020-05-08 06:14:42 +02:00
Mariusz Felisiak
106e8dc91a
Completed test coverage for ExclusionConstraint.
Dropping exclusion constraints was untested.
2020-05-07 10:02:14 +02:00
Carlton Gibson
92507bf3ea Fixed #31515 -- Made ASGIHandler dispatch lifecycle signals with thread sensitive. 2020-05-06 09:42:02 +02:00
Adam Johnson
1c2c6f1b51
Fixed a/an typos in "SQL" usage. 2020-05-06 06:35:26 +02:00
Mariusz Felisiak
fb52176a6f Made DateTimePickerShortcutsSeleniumTests.test_date_time_picker_shortcuts() less flaky.
Moved picking the current time closer to the actual click.
2020-05-05 11:00:05 +02:00
Mariusz Felisiak
b73e66e758
Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

Thanks Simon Meers for the report.
2020-05-05 09:08:29 +02:00
David Smith
2522559d1a Fixed #31534 -- Deprecated django.conf.urls.url(). 2020-05-05 07:34:34 +02:00
Adam Johnson
d17b380653 Refs #30573 -- Rephrased "Of Course" and "Obvious(ly)" in documentation and comments. 2020-05-04 12:10:47 +02:00
Rasmus Wriedt Larsen
f6d0bd208a
Corrected opts argument of colorize in TermColorTests.test_colorize_empty_text(). 2020-05-04 11:34:08 +02:00
Tom Forbes
c00bc27945 Refs #30372 -- Stopped watching built-in Django translation files by auto-reloader. 2020-05-04 09:13:47 +02:00
Nick Pope
8f10ceaa90 Changed '%s' % value pattern to str(value). 2020-05-04 08:27:18 +02:00
François Freitag
a0df5dea33
Removed unnecessary inner methods in CreatesuperuserManagementCommandTestCase. 2020-05-01 20:51:44 +02:00
Ian Foote
b4068bc656 Fixed #31455 -- Added support for deferrable exclusion constraints on PostgreSQL. 2020-05-01 09:08:36 +02:00
Ian Foote
c226c6cb32 Fixed #20581 -- Added support for deferrable unique constraints. 2020-04-30 10:43:50 +02:00
Mariusz Felisiak
555e3a848e
Removed unused __str__() methods in tests models.
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2020-04-30 09:13:23 +02:00
Hasan Ramezani
f121621073 Fixed #31521 -- Skipped test_parsing_rfc850 test on 32-bit systems. 2020-04-30 06:51:47 +02:00
Mariusz Felisiak
54646a423b
Refs #27468 -- Made user sessions use SHA-256 algorithm. 2020-04-29 16:45:00 +02:00
Jon Dufresne
0dafadadb9 Refs #30400 -- Improved typography of user facing strings in admin changelist. 2020-04-29 07:01:46 +02:00
Jon Dufresne
bdff97d373 Added tests for saving with pending actions in admin changelist. 2020-04-29 07:01:41 +02:00
Hasan Ramezani
68fc21b378 Fixed #29249 -- Made JSON and YAML serializers use Unicode by default. 2020-04-28 11:11:39 +02:00
Hasan Ramezani
8970bb4cfd Refs #29249 -- Added tests for serializing Unicode data with XML serializer. 2020-04-28 11:11:39 +02:00
François Freitag
9ef4a18dbe Changed django.forms.ValidationError imports to django.core.exceptions.ValidationError.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-04-28 10:49:00 +02:00
Richard Campen
67b334fbaf Fixed #31517 -- Fixed HashedFilesMixin.hashed_name() if hash of the file is None. 2020-04-28 08:25:07 +02:00
François Freitag
f19bb54fb1 Added test for squashmigrations' output. 2020-04-28 06:32:43 +02:00
François Freitag
abea86f9e4 Removed unnecessary tuple wrapping of single format string argument. 2020-04-27 08:30:16 +02:00
François Freitag
687cb38a05 Removed unnecessary capturing/hiding of stdout/stderr in various tests. 2020-04-27 08:06:12 +02:00
François Freitag
a8d175c297 Disabled management commands output with verbosity 0 in test_regression_22823_unmigrated_fk_to_migrated_model. 2020-04-27 07:43:09 +02:00
François Freitag
da606513db
Removed unnecessary capturing of stdout in test_makemigrations_non_interactive_not_null_addition. 2020-04-25 20:53:53 +02:00