Commit Graph

11930 Commits

Author SHA1 Message Date
Nick Pope 34363a391b Fixed #32735 -- Made DateFormat.Y() return a zero-padded year. 2021-05-12 08:17:06 +02:00
Mariusz Felisiak b1a4b1f0bd Fixed #32722 -- Fixed comparing to TruncTime() on Oracle. 2021-05-11 09:19:25 +02:00
Jordi Castells 205c36b58f Fixed #32670 -- Allowed GDALRasters to use any GDAL virtual filesystem. 2021-05-07 20:03:46 +02:00
Hasan Ramezani 028f10fac6 Fixed #32712 -- Deprecated django.utils.baseconv module. 2021-05-07 11:57:40 +02:00
Alex Hill c4ee3b208a Fixed #32699 -- Fixed comparing to TruncTime() with 0 microseconds on MySQL. 2021-05-07 08:13:40 +02:00
Mariusz Felisiak 65a9d0013d
Removed unused TestHashedFiles._max_post_process_passes.
Unused since f1894bae30
2021-05-06 12:26:25 +02:00
Mariusz Felisiak e1e81aa1c4
Fixed #32713, Fixed CVE-2021-32052 -- Prevented newlines and tabs from being accepted in URLValidator on Python 3.9.5+.
In Python 3.9.5+ urllib.parse() automatically removes ASCII newlines
and tabs from URLs [1, 2]. Unfortunately it created an issue in
the URLValidator. URLValidator uses urllib.urlsplit() and
urllib.urlunsplit() for creating a URL variant with Punycode which no
longer contains newlines and tabs in Python 3.9.5+. As a consequence,
the regular expression matched the URL (without unsafe characters) and
the source value (with unsafe characters) was considered valid.

[1] https://bugs.python.org/issue43882 and
[2] 76cd81d603
2021-05-06 08:45:23 +02:00
Carlton Gibson a708f39ce6 Refs CVE-2021-31542 -- Skipped mock AWS storage test on Windows.
The validate_file_name() sanitation introduced in
0b79eb3691 correctly rejects the example
file name as containing path elements on Windows. This breaks the test
introduced in 914c72be2a to allow path
components for storages that may allow them.

Test is skipped pending a discussed storage refactoring to support this
use-case.
2021-05-06 07:04:52 +02:00
ecogels a0a5e0f4c8 Fixed #32705 -- Prevented database cache backend from checking .rowcount on closed cursor.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-05-05 12:41:59 +02:00
Simon Charette 136ff592ad Fixed #32690 -- Fixed __in lookup crash when combining with filtered aggregates.
Having lookups group by subquery right-hand-sides is likely unnecessary
in the first place but relatively large amount of work would be needed
to achieve that such as making Lookup instances proper resolvable
expressions.

Regression in 3543129822.

Thanks James A. Munsch for the report.
2021-05-05 11:41:35 +02:00
Maxim Beder 06fd4df41a Fixed #32479 -- Added fallbacks to subsequent language codes in translations.
Thanks Claude Paroz and Nick Pope for reviews.
2021-05-05 09:37:54 +02:00
Simon Charette 96f55ccf79 Fixed #32714 -- Prevented recreation of migration for Meta.ordering with OrderBy expressions.
Regression in c8b6594305.

Thanks Kevin Marsh for the report.
2021-05-05 08:43:57 +02:00
Karthikeyan Singaravelan f9f6bd63c9 Refs #32074 -- Removed usage of deprecated Thread.setDaemon().
Thread.setDaemon() was deprecated in Python 3.10 and will be removed in
Python 3.12.
2021-05-04 12:07:18 +02:00
Florian Apolloner 0b79eb3691 Fixed CVE-2021-31542 -- Tightened path & file name sanitation in file uploads. 2021-05-04 08:44:42 +02:00
Hasan Ramezani 8de4ca74ba Fixed #32693 -- Quoted and lowercased generated column aliases. 2021-05-04 07:36:56 +02:00
Mariusz Felisiak 1f643c28b5
Fixed #32653 -- Made quoting names in the Oracle backend consistent with db_table. 2021-04-30 12:59:07 +02:00
Tim Graham 54da6e2ac2 Fixed #32678 -- Removed SECURE_BROWSER_XSS_FILTER setting. 2021-04-30 12:32:52 +02:00
Hasan Ramezani 8bcb00858e Fixed #32698 -- Moved HttpRequest.get_raw_uri() to ExceptionReporter._get_raw_insecure_uri(). 2021-04-30 08:05:42 +02:00
Nick Pope 2161db0792
Fixed capitalization of "ECMAScript" and "JavaScript". 2021-04-29 20:29:08 +02:00
Simon Charette c8b6594305 Fixed #32632, Fixed #32657 -- Removed flawed support for Subquery deconstruction.
Subquery deconstruction support required implementing complex and
expensive equality rules for sql.Query objects for little benefit as
the latter cannot themselves be made deconstructible to their reference
to model classes.

Making Expression @deconstructible and not BaseExpression allows
interested parties to conform to the "expression" API even if they are
not deconstructible as it's only a requirement for expressions allowed
in Model fields and meta options (e.g. constraints, indexes).

Thanks Phillip Cutter for the report.

This also fixes a performance regression in bbf141bcdc.
2021-04-28 12:13:55 +02:00
Mariusz Felisiak 4f600673d7 Refs #32632 -- Added tests for returning a copy when combining Q() objects. 2021-04-28 11:31:17 +02:00
Konstantin Alekseev 6e742dabc9 Fixed #32687 -- Restored passing process’ environment to underlying tool in dbshell on PostgreSQL.
Regression in bbe6fbb876.
2021-04-27 10:43:35 +02:00
Mariusz Felisiak 1871182031 Fixed #32682 -- Made admin changelist use Exists() instead of distinct() for preventing duplicates.
Thanks Zain Patel for the report and Simon Charette for reviews.

The exception introduced in 6307c3f1a1
revealed a possible data loss issue in the admin.
2021-04-27 10:34:47 +02:00
Mariusz Felisiak cd74aad90e Refs #32682 -- Renamed use_distinct variable to may_have_duplicates.
QuerySet.distinct() is not the only way to avoid duplicate, it's also
not preferred.
2021-04-27 10:34:47 +02:00
Mariusz Felisiak 4074f38e1d Refs #32682 -- Fixed QuerySet.delete() crash on querysets with self-referential subqueries on MySQL. 2021-04-27 10:34:47 +02:00
Mariusz Felisiak 158eca4f93 Refs #19080 -- Added tests for preserving select_related() in the admin changelist. 2021-04-27 10:34:47 +02:00
Mariusz Felisiak d68be0494b
Refs 32637 -- Made technical 404 debug page display exception message when URL is resolved.
Follow up to 3b8527e32b.
2021-04-27 08:40:52 +02:00
Hannes Ljungberg eab71f7690 Fixed #32686 -- Removed unnecessary semicolon on collected multiline SQL for RunSQL. 2021-04-27 08:01:07 +02:00
Hannes Ljungberg 95754dbc9b Refs #32686 -- Added tests for adding a semicolon when collecting SQL for RunSQL. 2021-04-27 07:59:41 +02:00
Zain Patel 4e5bbb6ef2 Fixed #32681 -- Fixed VariableDoesNotExist when rendering some admin template.
Regression in 84609b3205.
2021-04-26 07:08:16 +02:00
Mariusz Felisiak af609c2f4d
Fixed isolation of test_rename_table_renames_deferred_sql_references(). 2021-04-26 06:11:13 +02:00
Simon Charette 170b006ce8 Fixed #32673 -- Fixed lookups crash when comparing against lookups on PostgreSQL.
Regression in 3a505c70e7.

Nonlitteral right-hand-sides of lookups need to be wrapped in
parentheses to avoid operator precedence ambiguities.

Thanks Charles Lirsac for the detailed report.
2021-04-23 15:38:32 +02:00
Mariusz Felisiak 2f435e75ab
Fixed isolation of test_showmigrations_unmigrated_app().
Follow up to 90916f050c.
2021-04-23 10:06:08 +02:00
Mariusz Felisiak ac2e6e6869
Fixed isolation of i18n.tests.FormattingTests.test_get_custom_format(). 2021-04-22 19:57:27 +02:00
Mariusz Felisiak 90916f050c
Fixed isolation of test_showmigrations_unmigrated_app(). 2021-04-22 17:43:58 +02:00
Mariusz Felisiak c3278bb71f
Used assertCountEqual() in ExcludeTests.test_exclude_subquery(). 2021-04-22 10:47:10 +02:00
Simon Charette 6d0cbe42c3 Fixed #32650 -- Fixed handling subquery aliasing on queryset combination.
This issue started manifesting itself when nesting a combined subquery
relying on exclude() since 8593e162c9 but
sql.Query.combine never properly handled subqueries outer refs in the
first place, see QuerySetBitwiseOperationTests.test_subquery_aliases()
(refs #27149).

Thanks Raffaele Salmaso for the report.
2021-04-21 09:49:15 +02:00
Mariusz Felisiak 34d1905712
Fixed #32665 -- Fixed caches system check crash when STATICFILES_DIRS is a list of 2-tuples.
Thanks Jared Lockhart for the report.

Regression in c36075ac1d.
2021-04-21 09:41:37 +02:00
Carlton Gibson 5c73fbb6a9 Fixed #32647 -- Restored multi-row select with shift-modifier in admin changelist.
Regression in 30e59705fc.
2021-04-21 08:31:06 +02:00
Tobias Bengfort 54e94640ac Refs #25287 -- Added support for multiplying and dividing DurationField by scalar values on SQLite. 2021-04-20 11:44:41 +02:00
François Freitag 6b0b3eafd6 Fixed #32664 -- Made PasswordResetTokenGenerator.secret validation lazy.
Django apps initialization to run management command triggers the admin
autodiscovery. Importing django.contrib.auth.tokens creates an instance
of PasswordResetTokenGenerator which required a SECRET_KEY.

For several management commands, the token generator is unused. It
should only complain about a missing SECRET_KEY when it is used.
2021-04-20 07:34:53 +02:00
François Freitag b13af4752f Refs #28017 -- Added test for PasswordResetTokenGenerator subclass with a custom secret. 2021-04-20 07:28:06 +02:00
Chris Jerdonek 413c15ef2e
Refs #32609 -- Simplified test_labels_set construction in runtests.py's setup().
Follow up to 7cf3a5786b.
2021-04-19 11:01:48 +02:00
Chris Jerdonek a41ed8f1b9 Refs #32611 -- Removed initial "Testing against ..." log message calls from --bisect/--pair runtests options. 2021-04-19 09:18:46 +02:00
Chris Jerdonek 9fa8460081 Fixed #32611 -- Prevented unecessary setup()/teardown() calls when using --bisect/--pair runtests options.
This commit changes runtests.py's bisect_tests() and paired_tests() to
change settings only when necessary, namely when specific test names
aren't provided.
2021-04-19 09:14:35 +02:00
David Wobrock aa4acc164d Fixed #29899 -- Made autodetector use model states instead of model classes.
Thanks Simon Charette and Markus Holtermann for reviews.
2021-04-16 11:18:10 +02:00
girishsontakke a815a6a315 Fixed #32641 -- Made DiscoverRunner print the number of found tests.
Thanks Chris Jerdonek for reviews.
2021-04-15 11:42:46 +02:00
Florian Apolloner 4511d14598 Fixed #32643 -- Fixed decoding of messages in the pre-Django 3.2 format.
Thanks Jan Pieter Waagmeester for the report.

Regression in 2d6179c819.
2021-04-14 22:52:59 +02:00
Mariusz Felisiak ca98729055
Fixed #32645 -- Fixed QuerySet.update() crash when ordered by joined fields on MySQL/MariaDB.
Thanks Matt Westcott for the report.

Regression in 779e615e36.
2021-04-14 21:11:17 +02:00
Arthur Jovart 08c60cce3b Fixed #32648 -- Fixed VariableDoesNotExist rendering sitemaps template. 2021-04-14 16:50:47 +02:00
Mariusz Felisiak 23fa29f6a6
Fixed #32649 -- Fixed ModelAdmin.search_fields crash when searching against phrases with unbalanced quotes.
Thanks Dlis for the report.

Regression in 26a413507a.
2021-04-14 12:23:47 +02:00
Hasan Ramezani a77c9a4229 Fixed #32635 -- Fixed system check crash for reverse o2o relations in CheckConstraint.check and UniqueConstraint.condition.
Regression in b7b7df5fbc.

Thanks Szymon Zmilczak for the report.
2021-04-14 10:06:18 +02:00
Hasan Ramezani 33abc55601 Refs #31530 -- Added test for joined OneToOneField in CheckConstraint.check 2021-04-14 09:37:55 +02:00
Mariusz Felisiak 3b8527e32b
Fixed #32637 -- Restored exception message on technical 404 debug page.
Thanks Atul Varma for the report.
2021-04-13 09:15:04 +02:00
Adam Johnson b8bb9e1549 Reduced the garbage collection frequency in runtests.py. 2021-04-13 07:43:29 +02:00
Iuri de Silvio 9760e262f8 Fixed #32627 -- Fixed QuerySet.values()/values_list() crash on combined querysets ordered by unannotated columns. 2021-04-12 21:11:40 +02:00
Chris Jerdonek 823a9e6bac Fixed #32416 -- Made ThreadedWSGIServer close connections after each thread.
ThreadedWSGIServer is used by LiveServerTestCase.
2021-04-12 10:23:56 +02:00
Claude Paroz e4430f22c8 Fixed #31937 -- Eased translation of time strings in some languages. 2021-04-10 20:23:12 +02:00
Adam Johnson 45a58c31e6 Fixed #32620 -- Allowed subclasses of Big/SmallAutoField for DEFAULT_AUTO_FIELD. 2021-04-08 13:17:08 +02:00
Claude Paroz 30e123ed35 Fixed #32575 -- Added support for SpatiaLite 5. 2021-04-08 09:36:29 +02:00
Claude Paroz 3ae4344bbd Dropped support for GEOS 3.5 and GDAL 2.0. 2021-04-07 20:39:30 +02:00
Adam Johnson d9de74141e Fixed #32442 -- Used converters on returning fields from INSERT statements. 2021-04-07 17:10:00 +02:00
Claude Paroz e3cfba0029 Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9. 2021-04-07 15:54:24 +02:00
Mariusz Felisiak c6859f1a68
Refs #32074 -- Backported Enum.__repr__() from Python 3.10.
Enum.__repr__() was changed in [1], we should use the same format in
Python < 3.10.

[1] https://bugs.python.org/issue40066
2021-04-07 10:28:40 +02:00
Carlton Gibson 5aea50e57f Updated asgiref dependency for 3.2 release series. 2021-04-06 10:38:43 +02:00
Mariusz Felisiak d4d800ca1a Fixed CVE-2021-28658 -- Fixed potential directory-traversal via uploaded files.
Thanks Claude Paroz for the initial patch.
Thanks Dennis Brinkrolf for the report.
2021-04-06 08:15:17 +02:00
Mariusz Felisiak 78fea27f69
Fixed #32614 -- Fixed MiddlewareSyncAsyncTests tests with asgiref 3.3.2+. 2021-04-06 08:03:43 +02:00
Claude Paroz 90b95d2959 Updated translations from Transifex.
Forwardport of 1ea5e98315 from stable/3.2.x.
2021-04-06 06:19:31 +02:00
Hugo Cachitas 8f6a7a0e9e Fixed #32594 -- Doc'd and tested that Signal.disconnect() with lazy references returns None. 2021-04-03 14:57:43 +02:00
Chris Jerdonek a89e975caf Fixed #32532 -- Made DiscoverRunner raise RuntimeError when a test label is a file path. 2021-04-02 12:54:08 +02:00
Adam Johnson e32722d160 Fixed #32383 -- Added source map support to ManifestStaticFilesStorage. 2021-04-02 12:21:21 +02:00
William Schwartz 9ee693bd6c Fixed #32316 -- Deferred accessing __file__.
Deferred accessing the module-global variable __file__ because the
Python import API does not guarantee it always exists—in particular, it
does not exist in certain "frozen" environments. The following changes
advanced this goal.

Thanks to Carlton Gibson, Tom Forbes, Mariusz Felisiak, and Shreyas
Ravi for review and feedback.
2021-04-01 14:33:30 +02:00
Hugo Cachitas f83214a3e1 Refs #32594 -- Added Signal.disconnect() test with a model class.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-03-31 11:01:48 +02:00
Maxim Milovanov d915dd1c58 Fixed #32204 -- Added quick filter to admin's navigation sidebar. 2021-03-31 09:31:37 +02:00
bankc db5b75f10f Fixed #31840 -- Added support for Cross-Origin Opener Policy header.
Thanks Adam Johnson and Tim Graham for the reviews.

Co-authored-by: Tim Graham <timograham@gmail.com>
2021-03-30 19:59:24 +02:00
Mariusz Felisiak f6018c1e63 Fixed #32595 -- Fixed SchemaEditor.quote_value() crash with bytes. 2021-03-30 11:42:15 +02:00
Mariusz Felisiak 3c75f1f3ca Refs #32595 -- Added MySQL's SchemaEditor.quote_value() tests for values with Unicode chars. 2021-03-30 11:42:15 +02:00
Chris Jerdonek 038940cf55 Fixed #29127 -- Prevented DiscoverRunner from hiding tagged test with syntax errors.
This mades _FailedTest objects always match tags in DiscoverRunner.
2021-03-30 10:26:20 +02:00
Daniyal 7c08f26bf0 Fixed #32260 -- Made View.as_view() do not use update_wrapper().
View.as_view() should not use update_wrapper() for copying attributes
it's unintended and have side-effects such as adding `self` to the
signature.

This also fixes system check for arguments of custom error handler
views with class-based views.

Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2021-03-30 07:58:09 +02:00
Nick Pope 41850eec99 Fixed #32572 -- Improved ResolverMatch.__repr__().
When a partial function was passed as the view, the __repr__() would
show the `func` argument as `functools.partial` which isn't very
helpful, especially as it doesn't reveal the underlying function or
arguments provided.
2021-03-29 11:28:56 +02:00
Nick Pope 2f13c476ab Fixed #31487 -- Added precision argument to Round(). 2021-03-29 09:43:08 +02:00
Hasan Ramezani ed0cc52dc3 Fixed #32585 -- Fixed Value() crash with DecimalField on SQLite. 2021-03-29 06:22:36 +02:00
Chris Jerdonek dcb06c2c68 Fixed #32591 -- Made DiscoverRunner order _FailedTest objects first.
Failures detected when loading tests are ordered before all of the
above for quicker feedback. This includes things like test modules that
couldn't be found or that couldn't be loaded due to syntax errors.
2021-03-26 12:18:27 +01:00
Chris Jerdonek ff514309e1 Fixed #32578 -- Fixed crash in CsrfViewMiddleware when a request with Origin header has an invalid host. 2021-03-25 10:34:58 +01:00
Mariusz Felisiak 5b618f239c
Fixed RemoteTestResultTest tests without tblib.
Follow up to e3bca22e7e.
2021-03-25 10:33:54 +01:00
Girish Sontakke 5388ff2a52
Fixed #32582 -- Removed unnecessary dot in names of cloned test databases on SQLite. 2021-03-25 06:37:01 +01:00
Mariusz Felisiak 83443e62d3
Optimized FkConstraintsTests.test_check_constraints by specifying a database table. 2021-03-24 12:18:00 +01:00
Adam Donaghy cdd0b213a8 Fixed #29606 -- Added type check for ALLOWED_HOSTS setting. 2021-03-24 09:18:44 +01:00
Nick Pope a96c730431 Fixed #32460 -- Allowed "label"/"do_not_call_in_templates" members in model choice enums. 2021-03-24 07:45:33 +01:00
Nick Pope 41e39c41c9 Refs #32460 -- Doc'd and tested that property names of model choice enums cannot be used as members. 2021-03-24 07:45:33 +01:00
Florian Demmer 3a185cee2a Fixed #32573 -- Fixed bounds in __iso_year lookup optimization. 2021-03-23 21:27:55 +01:00
Mariusz Felisiak 2cd4026334
Refs #32353, Refs #32352 -- Fixed GIS tests with PROJ 7.X.
Different PROJ versions use different transformations, all are correct
as having a 1 meter accuracy.

These are differences in PROJ versions that cannot and should not be
handled in Django itself.

Thanks Jani Tiainen and David Smith for reports.

See: https://github.com/OSGeo/gdal/issues/3377
2021-03-23 09:16:33 +01:00
Mariusz Felisiak 71ec102b01 Fixed #32483 -- Fixed QuerySet.values()/values_list() on JSONField key transforms with booleans on SQLite.
Thanks Matthew Cornell for the report.
2021-03-23 08:28:47 +01:00
Mariusz Felisiak c4df8b86c7 Refs #32483 -- Added tests QuerySet.values()/values_list() on key transforms with structures containing booleans. 2021-03-23 08:27:14 +01:00
Mariusz Felisiak 037607ff19 Refs #31936 -- Added tests for __in lookup on JSONField key transforms with booleans. 2021-03-23 08:27:14 +01:00
Adam Johnson 562898034f Refs #31732 -- Fixed django.utils.inspect caching for bound methods.
Thanks Alexandr Artemyev for the report, and Simon Charette for the
original patch.
2021-03-22 13:17:54 +01:00
Adam Johnson ac72a216a7 Refs #31372 -- Added django.utils.inspect tests for bound methods. 2021-03-22 13:17:46 +01:00
Mariusz Felisiak 717b5e633a
Made CsrfViewMiddlewareTestMixin._get_GET_no_csrf_cookie_request() return GET requests. 2021-03-22 08:22:58 +01:00
Claude Paroz d11b9ffcc0 Fixed #32581 -- Prevented to_locale() from corrupting locale names. 2021-03-22 07:08:58 +01:00
Claude Paroz 9d130920e6 Added to_locale() tests for 3-char language codes. 2021-03-22 06:58:44 +01:00
Baptiste Mispelon 41e6b2a3c5 Fixed #32556 -- Fixed handling empty string as non-boolean attributes value by assertHTMLEqual(). 2021-03-19 20:41:57 +01:00
Adam Donaghy e49fdfa405 Fixed #32571 -- Made CsrfViewMiddleware handle invalid URLs in Referer header. 2021-03-19 11:19:19 +01:00
Daniyal 474cc420bf Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.core. 2021-03-19 08:04:37 +01:00
Tim Graham 2411b8b5eb Fixed #16010 -- Added Origin header checking to CSRF middleware.
Thanks David Benjamin for the original patch, and Florian
Apolloner, Chris Jerdonek, and Adam Johnson for reviews.
2021-03-18 20:25:20 +01:00
Tim Graham dba44a7a7a Refs #16010 -- Required CSRF_TRUSTED_ORIGINS setting to include the scheme. 2021-03-18 20:00:22 +01:00
Hasan Ramezani 9bf5e9418f Fixed #32556 -- Fixed assertHTMLEqual() to handle empty string as boolean attributes value. 2021-03-18 16:30:15 +01:00
Adam Johnson f6713cda89 Fixed #31370 -- Added support for parallel tests with --buffer. 2021-03-18 15:30:47 +01:00
Adam Johnson e3bca22e7e Refs #31370 -- Made RemoteTestResult subclass unittest.TestResult. 2021-03-18 15:30:47 +01:00
Adam Johnson 92975bcd5f Refs #31370 -- Added test for pickling RemoteTestResult. 2021-03-18 15:30:47 +01:00
Johannes Maron 03d0f12c82 Fixed #32466 -- Corrected autocomplete to_field resolution for complex cases.
In MTI or ForeignKey as primary key cases, it is required to fetch the attname
from the field instance on the remote model in order to reliably resolve the
to_field_name.

Co-authored-by: Johannes Maron <info@johanneshoppe.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2021-03-18 11:21:23 +01:00
Johannes Maron 0b120f5d64 Refs #29138 -- Added extra tests for autocomplete FK to_field variations. 2021-03-18 11:14:18 +01:00
Jonathan Richards 00b0786de5 Fixed #32548 -- Fixed crash when combining Q() objects with boolean expressions. 2021-03-17 21:53:39 +01:00
Mariusz Felisiak 54f60bc85d Refs #32548 -- Added tests for passing conditional expressions to Q(). 2021-03-17 21:53:36 +01:00
Tiago Honorato 4f4f770f77 Refs #24121 -- Added __repr__() to Origin and Template. 2021-03-17 07:49:55 +01:00
Daniyal 54d9179540 Refs #32508 -- Raised ImproperlyConfigured instead of using "assert" in SessionStorage. 2021-03-16 09:01:49 +01:00
Yuri Konotopov 330bc402a8 Fixed #32546 -- Avoided Meta.ordering columns in GROUP BY clauses.
Follow up to 0ddb4ebf7b.
2021-03-16 07:58:38 +01:00
Hasan Ramezani 775b796d8d Refs #32508 -- Raised ValueError instead of using "assert" in lazy(). 2021-03-15 13:10:30 +01:00
Hasan Ramezani 2cd0ccef04 Added tests for AssertionErrors in get_complete_version() and _lazy_re_compile(). 2021-03-15 13:03:30 +01:00
manav014 99640e24b4 Fixed #31516 -- Improved naming of migrations with multiple operations.
52 gives 60 in total (52 + 5 + 3).

Co-authored-by: Adam Johnson <me@adamj.eu>
2021-03-12 11:56:12 +01:00
Adam Johnson 927fead2f5 Refs #31516 -- Added Migration.suggest_name() tests for migrations with no operations. 2021-03-12 11:56:12 +01:00
Adam Johnson b1cb923883 Refs #31516, Refs #31703 -- Made makemigrations always name initial migrations "initial". 2021-03-12 09:19:23 +01:00
Chris Jerdonek d828beb68f Fixed #32529 -- Delayed creating a test suite in build_suite(). 2021-03-11 10:02:06 +01:00
Chris Jerdonek d8a4bcffdb Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of tests. 2021-03-11 09:23:33 +01:00
Hasan Ramezani a2d5ea626e Refs #32508 -- Raised ImproperlyConfigured instead of using "assert" in middlewares. 2021-03-11 08:34:28 +01:00
Jonny Park dc86a25a67 Refs #24121 -- Added __repr__() to MiddlewareMixin and subclasses. 2021-03-10 21:16:58 +01:00
Mariusz Felisiak a6a94fb966
Removed unnecessary lines in test_has_view_or_change_permission_required().
AutocompleteJsonViewTests.user is already a staff member.
2021-03-10 15:37:28 +01:00
Nick Pope afb0eb8bb3
Refs #24121 -- Added __repr__() to OrderedSet. 2021-03-10 09:29:05 +01:00
Mariusz Felisiak ba9a2b7544
Refs #32508 -- Raised TypeError instead of using "assert" on unsupported operations for sliced querysets. 2021-03-10 09:16:28 +01:00
Chris Jerdonek 77e0a35a10 Fixed #32516 -- Fixed reorder_suite() with duplicates and reverse=True. 2021-03-09 13:30:51 +01:00
Markus Holtermann d9a266d657 Updated Git branch "master" to "main".
This change follows a long discussion on django-develops:

https://groups.google.com/g/django-developers/c/tctDuKUGosc/
2021-03-09 08:48:32 +01:00
Tim Graham 76c0b32f82
Refs #26167 -- Added @skipUnlessDBFeature('supports_expression_indexes') to a test.
Failure observed on CockroachDB.
2021-03-08 20:12:26 +01:00
Diego Lima 2e5aa444d1 Fixed #32517 -- Made OrderedSet reversible.
Refs #32516.
2021-03-08 08:22:07 +01:00
Johan Schiff d01709aae2 Fixed #24141 -- Added QuerySet.contains(). 2021-03-06 20:40:29 +01:00
Chris Jerdonek 22c9af0eae Fixed #32489 -- Added iter_test_cases() to iterate over a TestSuite.
This also makes partition_suite_by_type(), partition_suite_by_case(),
filter_tests_by_tags(), and DiscoverRunner._get_databases() to use
iter_test_cases().
2021-03-05 13:04:07 +01:00
Hasan Ramezani 20ddc3b81d Fixed #32494 -- Adjusted system check for raw_id_fields to warn about Field.attname. 2021-03-04 08:41:28 +01:00
Hasan Ramezani 1da54bfe7d Corrected messages of admin checks for invalid model field names. 2021-03-04 08:41:28 +01:00
Jacob Walls b23232b6ab Fixed #27854 -- Added system check for nonexistent directories in STATICFILES_DIRS setting. 2021-03-03 11:27:08 +01:00
Mariusz Felisiak 7186c536c4 Used CollectionTestCase in FindersCheckTests tests. 2021-03-03 11:20:13 +01:00
François Freitag 7ca7f4495b Refs #21429 -- Added SimpleTestCase.assertNoLogs() on Python < 3.10. 2021-03-02 20:35:33 +01:00
Rohith PR d3ecef26b9 Refs #24121 -- Added __repr__() to URLNode. 2021-03-02 12:24:49 +01:00
Jacob Walls 73b1b225ce Fixed #22640 -- Raised TypeError when instantiating model with keyword and positional args for the same field. 2021-03-01 20:26:39 +01:00
Hasan Ramezani 8380fe08a0 Fixed #32456 -- Added dbshell support for specifying a password file on PostgreSQL. 2021-03-01 09:33:49 +01:00
Jacob Walls 64a0d1ef6e Fixed typo in assertQuerysetEqual() exception message. 2021-02-26 21:12:11 +01:00
Mariusz Felisiak 8908846444
Refs #32292 -- Made dbshell do not use 'postgres' database when service name is set.
Regression in dcb3ad3319.
2021-02-26 20:53:01 +01:00
Jacob Walls 9d7e31cc74
Removed unused code in admin_views tests.
Unused since its introduction in 7b21bfc074
and 1e4ad6f118.
2021-02-26 20:49:21 +01:00
Jacob Walls 337cd652a5 Fixed #28607 -- Prevented duplicates in HashedFilesMixin post-processing results.
Thanks Ed Morley for the implementation idea.
2021-02-26 11:38:32 +01:00
David Smith 179ee13eb3 Refs #24121 -- Added __repr__() to FilterExpression, Lexer, Parser, and Token. 2021-02-26 10:25:08 +01:00
Simon Charette 3089018e95 Fixed #32446 -- Deprecated SERIALIZE test database setting.
Whether or not the state of a test database should be serialized can be
inferred from the set of databases allowed to be access from discovered
TestCase/TransactionTestCase enabling the serialized_rollback feature
which makes this setting unnecessary.

This should make a significant test suite bootstraping time difference
on large projects that didn't explicitly disable test database
serialization.
2021-02-24 20:31:11 +01:00
Haki Benita 3fd82a6241 Refs #32468 -- Added error message on invalid usage of cache decorators. 2021-02-24 10:13:51 +01:00
Simon Charette 277eea8fcc Fixed #32478 -- Included nested columns referenced by subqueries in GROUP BY on aggregations.
Regression in fb3f034f1c.

Refs #31094, #31150.

Thanks Igor Pejic for the report.
2021-02-24 09:01:36 +01:00
Hannes Ljungberg 3aa545281e Fixed #30916 -- Added support for functional unique constraints.
Thanks Ian Foote and Mariusz Felisiak for reviews.
2021-02-23 20:19:53 +01:00
Marc Gibbons d6572ee4b0 Fixed #32470 -- Fixed ResolverMatch instance on test clients when request.urlconf is set. 2021-02-23 09:54:49 +01:00
Mariusz Felisiak fb93363c49
Fixed DataUploadMaxNumberOfFieldsFormPost.test_number_exceeded().
Follow up to 0ad9fa02e0.
2021-02-23 09:47:30 +01:00
Chris Jerdonek 5c4c3e2d1f Fixed #32445 -- Fixed LiveServerThreadTest.test_closes_connections() for non-in-memory database on SQLite. 2021-02-23 06:08:43 +01:00
Nick Pope 0e4e35722a Fixed #32469 -- Made assertQuerysetEqual() respect maxDiff when ordered=False. 2021-02-22 09:27:46 +01:00
Hannes Ljungberg 87acbf0631 Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent. 2021-02-19 20:25:11 +01:00
Hasan Ramezani 7c18b22e2f Fixed #32256 -- Fixed migration optimization crash when swapping field names.
This disables optimization of RenameField operation when an old field
name is referenced in subsequent operations.

Co-authored-by: InvalidInterrupt <InvalidInterrupt@users.noreply.github.com>
2021-02-19 11:19:01 +01:00
Nick Pope 0ad9fa02e0 Refs CVE-2021-23336 -- Updated tests and release notes for affected versions. 2021-02-19 09:03:06 +01:00
David Smith 96a5093400
Refs #30231 -- Fixed SeleniumTests.test_inlines_verbose_name 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
even after fixing #32459.
2021-02-19 07:15:54 +01:00
Hasan Ramezani f2bef2b7bc Fixed #32455 -- Allowed right combining Q() with boolean expressions. 2021-02-18 22:20:36 +01:00
Mariusz Felisiak efce21497c Refs #32455 -- Added tests for left combining an empty Q() with boolean expressions. 2021-02-18 22:19:56 +01:00
starryrbs 466920f6d7 Fixed #32450 -- Fixed crash when ANDing/ORing an empty Q() with not pickleable Q().
Regression in bb0b6e5263.
2021-02-18 21:13:24 +01:00
Amir Ajorloo 1710cdbe79
Fixed #32443 -- Removed "shifted" CSS class when admin's sidebar is disabled. 2021-02-18 09:18:19 +01:00
Hannes Ljungberg 4d99375b46 Fixed #32453 -- Added introspection of unique constraint field ordering on SQLite.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-02-17 10:59:17 +01:00
Teresa Partida 45bef6706a Fixed #30231 -- Fixed admin filter horizontal/vertical verbose_name generation.
Co-authored-by: David Smith <smithdc@gmail.com>
2021-02-16 14:26:53 +01:00
Harm Geerts 06e5f7ae16 Fixed #29052 -- Made test database creation preserve alias order and prefer the "default" database.
This fixes flushing test databases when two aliases point to the same
database.

Use a list() to store the test database aliases so the order remains
stable by following the order of the connections. Also, always use the
"default" database alias as the first alias to accommodate `migrate`.

Previously `migrate` could be executed on a secondary alias which
caused truncating the "default" database.
2021-02-16 10:25:34 +01:00
manav014 3119a6deca Fixed #26607 -- Allowed customizing formset kwargs with ModelAdmin.get_formset_kwargs().
Thanks Nick Pope for reviews.
2021-02-15 11:37:35 +01:00
Chris Jerdonek fc0069bfa5 Refs #32417 -- Improved cleaning up and fixed isolation of staticfiles_tests tests. 2021-02-15 10:23:54 +01:00
Chris Jerdonek 694deff82f Fixed #32437 -- Fixed cleaning up ALLOWED_HOSTS in LiveServerTestCase on setUpClass() failure. 2021-02-12 09:39:48 +01:00
Chris Jerdonek 91c243f80f Refs #32416 -- Added LiveServerThread.server_class to ease subclassing. 2021-02-12 08:17:46 +01:00
Egidijus Macijauskas 6307c3f1a1 Fixed #32433 -- Added error message on QuerySet.delete() following distinct(). 2021-02-11 08:33:30 +01:00
Egidijus Macijauskas 4e8ecf0cb6 Refs #19102 -- Removed flaky test Ticket19102Tests.test_ticket_19102_distinct_on.
The subquery pushdown only happens because another table is involved in
filter. It's not the distinct usage that causes the pushdown.

The distinct('description').order_by('pk') expression is not valid
because SELECT DISTINCT ON must match initial ORDER BY expressions
which is not the case here.
2021-02-11 08:33:30 +01:00
Ramon Saraiva dcb094abe8 Fixed #32421 -- Made admindocs ModelDetailView show model cached properties. 2021-02-11 06:50:50 +01:00
Mariusz Felisiak ec0ff40631 Fixed #32355 -- Dropped support for Python 3.6 and 3.7 2021-02-10 10:20:54 +01:00
Josh Santos 9c6ba87692 Fixed #32145 -- Improved makemessages error message when app's locale directory doesn't exist. 2021-02-09 20:00:20 +01:00
Jordan Bae d4ac23bee1 Fixed #32425 -- Fixed adding nullable field with default on MySQL.
Thanks Simon Charette for the review.
2021-02-09 06:59:31 +01:00
ThinkChaos b99d6c9cbc Fixed #28216 -- Added next_page/get_default_redirect_url() to LoginView. 2021-02-08 21:08:05 +01:00
Markus Holtermann 50a5f8840f Refs #32394 -- Changed STATIC_URL/MEDIA_URL to relative paths in tests and docs where appropriate. 2021-02-06 13:41:35 +01:00
Hasan Ramezani 63d239db03 Fixed #32411 -- Fixed __icontains lookup for JSONField on MySQL. 2021-02-05 16:14:12 +01:00
Mikolaj Rybinski 8e90560aa8 Fixed #32420 -- Fixed detecting primary key values in deserialization when PK is also a FK. 2021-02-05 12:33:43 +01:00
Daniel Ebrahimian 3f8979e37b Fixed #32350 -- Fixed showmigrations crash for applied squashed migrations.
Thanks Simon Charette for reviews.
2021-02-04 21:17:26 +01:00
Mariusz Felisiak ae48601e6d
Skipped test_archive tests when bz2/lzma module is not installed. 2021-02-04 14:08:43 +01:00
Simon Charette f23b05696e Fixed #32395 -- Allowed capturing stdout of migration signals. 2021-02-04 11:19:49 +01:00
Simon Charette 31bebc558b Used subTest() in migrate_signals.tests.MigrateSignalTests.test_args(). 2021-02-04 11:19:49 +01:00
Jim Xie ce60d28929 Fixed #31527 -- Allowed admindocs index to handle non-string URLconfs. 2021-02-04 10:11:58 +01:00
Hasan Ramezani 7cba92ec55 Fixed #32332 -- Fixed loss of parent with non-numeric pk when saving child after parent.
Follow up to 519016e5f2.
2021-02-04 06:06:00 +01:00
Mariusz Felisiak f39634ff22 Refs #32390 -- Bumped required cx_Oracle to 7.0. 2021-02-03 10:03:33 +01:00
Mariusz Felisiak f131841c60
Fixed #32403 -- Fixed re-raising DatabaseErrors when using only 'postgres' database.
Thanks Kazantcev Andrey for the report.

Regression in f48f671223.
2021-02-02 21:34:36 +01:00
Mariusz Felisiak 05413afa8c Fixed CVE-2021-3281 -- Fixed potential directory-traversal via archive.extract().
Thanks Florian Apolloner, Shai Berger, and Simon Charette for reviews.

Thanks Wang Baohua for the report.
2021-02-01 09:07:36 +01:00
Sandro Covo 6822aa5c6c Fixed #32345 -- Fixed preserving encoded query strings in set_language() view.
Thanks Johannes Maron for the review.
2021-01-29 11:58:43 +01:00
Tilman Koschnick fdfbc66331 Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in expressions. 2021-01-29 11:05:00 +01:00
Mariusz Felisiak 135c800fe6
Fixed GeoIPTest.test04_city() failure with the latest GeoIP2 database. 2021-01-29 11:00:12 +01:00
Illia Volochii 3c004075b1 Fixed #32389 -- Fixed ResponseHeaders crash when data is not mapping. 2021-01-28 10:10:08 +01:00
Hasan Ramezani c978dd93fd Fixed #32290 -- Fixed TemplateNotFound in {% include %} tag for relative path in variable. 2021-01-27 10:07:31 +01:00
Hasan Ramezani 640a6e1dce Refs #32290 -- Added {% extends %} test for relative path in variable. 2021-01-27 09:37:03 +01:00
Mariusz Felisiak b989d21336
Refs #26602 -- Added tests for aggregating over a RawSQL() annotation.
Fixed in 3f32154f40.

Thanks Manav Agarwal for initial test.
2021-01-26 10:59:05 +01:00
Jerin Peter George 1adc09064f Fixed #32347 -- Made ModelChoiceField include the value in ValidationError for invalid_choice. 2021-01-26 09:31:53 +01:00
Simon Charette 42e8cf47c7 Fixed #32369 -- Fixed adding check constraints with pattern lookups and expressions as rhs.
This disables interpolation of constraint creation statements. Since
Constraint.create_sql interpolates its parameters instead of deferring
this responsibility to the backend connection it must disable
connection level parameters interpolation.
2021-01-26 06:41:57 +01:00
Mariusz Felisiak 84ad7f3404
Refs #32380 -- Added test for distance lookups with F() expression.
Fixed in 5935a9aead.
2021-01-25 08:40:46 +01:00
Timothy McCurrach b1821fbad5 Fixed #32360 -- Added system check for FILE_UPLOAD_TEMP_DIR setting. 2021-01-22 07:51:00 +01:00
Mariusz Felisiak a03a36121d Fixed #32367 -- Fixed system check for specifying type of auto-created primary keys for inherited PKs.
Regression in b5e12d490a.

Thanks אורי for the report.
2021-01-21 09:03:07 +01:00
Simon Charette 0c42cdf0d2 Fixed #32374 -- Stopped recording migration application before deferred SQL.
Migrations cannot be recorded in the same transaction as its associated
DDL operations when some of it is deferred until the schema editor
context exits.

Regression in c86a3d80a2.
2021-01-21 07:03:35 +01:00
Simon Charette 533a583578 Refs #29721 -- Simplified migration used to test atomic recording.
This makes sure atomic recording of migration application is used when
the schema editor doesn't defer any statement.
2021-01-21 06:50:23 +01:00
Hasan Ramezani dcb3ad3319 Fixed #32292 -- Added support for connection by service name to PostgreSQL. 2021-01-20 17:30:37 +01:00
Mariusz Felisiak cfddca543a
Fixed isolation of utils_tests.test_autoreload tests. 2021-01-20 09:53:34 +01:00
Mariusz Felisiak 5371342ed6
Fixed #32357 -- Dropped support for PostgreSQL 9.6 and PostGIS 2.3. 2021-01-19 12:25:20 +01:00
Paul Ganssle 10d1261984 Refs #32365 -- Allowed use of non-pytz timezone implementations. 2021-01-19 11:59:37 +01:00
Hasan Ramezani 34aa4f1997 Fixed #32296 -- Added --skip-checks option to runserver command. 2021-01-18 12:51:35 +01:00
Mariusz Felisiak e8b4f23115 Fixed isolation of test_check_errors_catches_all_exceptions. 2021-01-18 12:51:35 +01:00
Illia Volochii bef6f75842 Fixed #32358 -- Fixed queryset crash when grouping by annotation with Distance()/Area().
Made MeasureBase hashable.
2021-01-18 09:58:50 +01:00
Timothy McCurrach 0aff3fd711 Fixed #18549 -- Fixed heading for inlines with a OneToOneField.
Used verbose_name instead of verbose_name_plural.
2021-01-18 08:12:19 +01:00
Timothy McCurrach 13409a0c0d Refs #18549 -- Added test for heading of foreign key inlines. 2021-01-18 07:38:12 +01:00
Mariusz Felisiak a948d9df39 Increased the default PBKDF2 iterations for Django 4.0. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak b4c5f878bd Advanced deprecation warnings for Django 4.0. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 0aa6a602b2 Refs #31842 -- Removed DEFAULT_HASHING_ALGORITHM transitional setting.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak e7208f13c0 Refs #25236 -- Removed {% ifequal %} and {% ifnotequal %} template tags per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 2dd6a83d2d Refs #12990 -- Removed django.contrib.postgres.forms.JSONField per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 8fdb5a656a Refs #12990 -- Removed django.contrib.postgres.fields.jsonb.KeyTransform/KeyTextTransform.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 7cb5712edc Refs #12990 -- Removed django.contrib.postgres.fields.JSONField per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 98ae3925e5 Refs #31534 -- Removed django.conf.urls.url() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak be6e468130 Refs #31359 -- Made get_random_string()'s length argument required.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak d992f4e3c2 Refs #31369 -- Removed models.NullBooleanField per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 06eec31970 Refs #7098 -- Removed support for passing raw column aliases to order_by().
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak bf770cc825 Refs #8760 -- Removed "list" message for ModelMultipleChoiceField per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 1adcf20385 Refs #31327 -- Removed providing_args argument for Signal per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 4bb30fe5d5 Refs #26601 -- Made get_response argument required and don't accept None in middleware classes.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 6b4941dd57 Refs #27468 -- Removed support for the pre-Django 3.1 user sessions.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak d32a232fe9 Refs #27468 -- Removed support for the pre-Django 3.1 signatures in Signer and signing.dumps()/loads().
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 8250145a0c Refs #31274 -- Removed support for the pre-Django 3.1 encoding format of sessions.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 66b4046d68 Refs #27468 -- Removed support for the pre-Django 3.1 password reset tokens.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 831a05b185 Refs #27604 -- Removed support for the pre-Django 3.1 encoding format in CookieStorage.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak d08977a0f0 Refs #30997 -- Removed HttpRequest.is_ajax() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 90c59b4e12 Refs #23433 -- Removed django-admin.py entry point per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 68e3ca13d7 Refs #30988 -- Removed InvalidQuery exception per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 396da8b94c Refs #30841 -- Made isnull lookup raise ValueError for non-boolean values.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 12ac4916af Refs #28622 -- Removed settings.PASSWORD_RESET_TIMEOUT_DAYS per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 9e456f3166 Refs #30747 -- Removed django.utils.http.is_safe_url() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 157ab32f34 Refs #27753 -- Removed django.utils.text.unescape_entities() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 5e33ec80d1 Refs #30158 -- Made alias argument required in signature of Expression.get_group_by_cols() subclasses.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak d134b0b93e Refs #15902 -- Stopped set_language() storing user's language in the session.
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Mariusz Felisiak 52a238ddf2 Refs #30165 -- Removed ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 810f037b29 Refs #27753 -- Removed django.utils.encoding.force_text() and smart_text() per deprecation timeline. 2021-01-14 17:50:04 +01:00
Mariusz Felisiak 88ed1c8d08 Refs #27753 -- Removed django.utils.http urllib aliases per deprecation timeline. 2021-01-14 17:50:04 +01:00
Hasan Ramezani f750377318 Fixed #32321 -- Added system checks for invalid model field names in functional indexes. 2021-01-14 12:27:00 +01:00
Jon Moroney 76ae6ccf85 Fixed #31358 -- Increased salt entropy of password hashers.
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
2021-01-14 11:20:28 +01:00
Jon Moroney 6bd206e1ff Refs #31358 -- Added bcrypt password hashers tests for must_update() with salt(). 2021-01-14 11:20:28 +01:00
Nick Pope 9204485396
Fixed #16117 -- Added decorators for admin action and display functions.
Refs #25134, #32099.
2021-01-13 17:19:22 +01:00
Hannes Ljungberg 83fcfc9ec8 Fixed #26167 -- Added support for functional indexes.
Thanks Simon Charette, Mads Jensen, and Mariusz Felisiak for reviews.

Co-authored-by: Markus Holtermann <info@markusholtermann.eu>
2021-01-13 11:47:50 +01:00
Tim Graham e3ece0144a Removed redundant database vendor helpers in gis_tests/utils.py. 2021-01-13 09:22:44 +01:00
Tim Graham 9f91122ed8 Added SpatialFeatures.empty_intersection_returns_none. 2021-01-13 09:22:44 +01:00
Hannes Ljungberg 4c62cdaa10 Refs #26709 -- Made Index raise ValueError on non-string fields. 2021-01-12 20:22:44 +01:00
Paolo Melchiorre c412d9af7e
Fixed #32291 -- Added fixtures compression support to dumpdata. 2021-01-12 15:47:58 +01:00
Jon Dufresne ba31b01034
Fixed #31747 -- Fixed model enumeration via admin URLs.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2021-01-12 14:37:56 +01:00
Johannes Maron 3071660acf
Fixed #29010, Fixed #29138 -- Added limit_choices_to and to_field support to autocomplete fields.
* Fixed #29010 -- Added limit_choices_to support to autocomplete fields.
* Fixed #29138 -- Allowed autocomplete fields to target a custom
  to_field rather than the PK.
2021-01-12 11:37:38 +01:00
Hasan Ramezani ba3fb2e4d0
Refs #32311 -- Fixed CSRF_FAILURE_VIEW system check errors code. 2021-01-12 11:22:13 +01:00
Hasan Ramezani 64331419c8
Fixed #32311 -- Added system check for CSRF_FAILURE_VIEW setting. 2021-01-12 09:44:36 +01:00
Florian Apolloner 2d6179c819 Fixed #32191 -- Made CookieStorage use RFC 6265 compliant format.
Co-authored-by: Craig Smith <hello@craigiansmith.com.au>
2021-01-07 13:00:53 +01:00
Florian Apolloner 102d92fc09 Refs #32191 -- Added Signer.sign_object()/unsign_object().
Co-authored-by: Craig Smith <hello@craigiansmith.com.au>
2021-01-06 20:16:47 +01:00
William Schwartz ec6d2531c5 Fixed #32314 -- Fixed detection when started non-django modules with "python -m" in autoreloader.
django.utils.autoreload.get_child_arguments() detected when Python was
started with the `-m` option only for `django` module. This commit
changes the logic to check __spec__, see
https://docs.python.org/3/reference/import.html#main-spec

Now packages can implement their own __main__ with the runserver
command.
2021-01-05 21:03:29 +01:00
Alexander Lyabah 415f50298f Fixed #32231 -- Allowed passing None params to QuerySet.raw(). 2021-01-05 10:37:11 +01:00
Alexander Lyabah aa3d360631 Refs #32231 -- Added tests for QuerySet.raw() with an escaped % symbol. 2021-01-05 10:36:30 +01:00
Akshat1Nar b41d38ae26 Fixed #32298 -- Fixed URLValidator hostname length validation.
URLValidator now validates the maximum length of a hostname without
the userinfo and port.
2021-01-04 09:25:40 +01:00
Tim Graham 060e6bdd1f
Replaced DatabaseFeatures.supports_left_right_lookups with skipUnlessGISLookup. 2021-01-02 21:39:48 +01:00
Mariusz Felisiak e13b71403b
Fixed #32304 -- Fixed prefixing STATIC_URL and MEDIA_URL by SCRIPT_NAME for absolute URLs with no domain.
Thanks Adam Hooper for the report.

Regression in c574bec092.
2020-12-31 13:18:57 +01:00
Hasan Ramezani a2e3f95b09 Fixed #31413 -- Fixed isolation of migrations.test_loader on databases that don't support transactions. 2020-12-31 08:18:51 +01:00
manav014 a9a7421ab8 Fixed #32294 -- Prevented ManyToManyField's hidden related name collisions between apps. 2020-12-30 13:11:47 +01:00
Mariusz Felisiak 74fd233b14
Fixed #32303 -- Bumped minimum supported SQLite to 3.9.0. 2020-12-30 09:01:56 +01:00
William Schwartz e64c1d8055 Fixed #32302 -- Allowed migrations to be loaded from regular packages with no __file__ attribute.
The migrations loader prevents the use of PEP-420 namespace packages
for holding apps' migrations modules. Previously the loader tested for
this only by checking that app.migrations.__file__ is present. This
prevented migrations' being found in frozen Python environments that
don't set __file__ on any modules. Now the loader *additionally* checks
whether app.migrations.__path__ is a list because namespace packages
use a different type for __path__. Namespace packages continue to be
forbidden, and, in fact, users of normal Python environments should
experience no change whatsoever.
2020-12-29 12:54:08 +01:00
Mariusz Felisiak 98ad327864
Fixed #32299 -- Prevented mutating handlers when processing middlewares marking as unused in an async context.
Thanks Hubert Bielenia for the report.
2020-12-29 09:04:35 +01:00
Mariusz Felisiak 45519937e5 Added app labels to related fields checks messages E302-E305. 2020-12-29 09:01:35 +01:00
Florian Apolloner c76d51b3ad Refs #31358 -- Fixed decoding salt in Argon2PasswordHasher.
Argon2 encodes the salt as base64 for representation in the final hash
output. To be able to accurately return the used salt from decode(),
add padding, b64decode, and decode from latin1 (for the remote
possibility that someone supplied a custom hash consisting solely of
bytes -- this would require a manual construction of the hash though,
Django's interface does not allow for that).
2020-12-28 11:02:08 +01:00
François Freitag b11ec9a69e Fixed #32301 -- Made clearsessions raise CommandError when clear_expired() is not implemented. 2020-12-28 09:30:16 +01:00
Chinmoy Chakraborty 270072c4c2 Fixed #32158 -- Fixed loaddata crash on SQLite when table/column names are SQL keywords. 2020-12-28 08:57:30 +01:00
Jacob Walls 89fc144ded Fixed #27827 -- Used "raise from" when raising InvalidTemplateLibrary exceptions in get_package_libraries().
This change sets the __cause__ attribute to raised exceptions and makes
small cleanups in error messages.
2020-12-28 07:31:37 +01:00
Mariusz Felisiak ada83fd8b8
Fixed isolation of test_migrate_fake_split_initial. 2020-12-23 07:48:45 +01:00
Hasan Ramezani 8b2a30f6f1 Fixed #32285 -- Raised ImproperlyConfigured when AppConfig.label is not a valid Python identifier. 2020-12-22 13:26:30 +01:00
starryrbs 2a76f43134 Fixed #32269 -- Fixed parse_duration() for negative days in ISO 8601 format. 2020-12-21 10:28:07 +01:00
starryrbs 57d05f94c3 Added more assertions for parse_duration() with negative timedeltas. 2020-12-21 10:15:22 +01:00
Hasan Ramezani 577f2338f1 Fixed #32208 -- Allowed adding lazy() objects.
Co-authored-by: Claude Paroz <claude@2xlibre.net>
2020-12-21 09:24:41 +01:00
Nick Pope 9ef0394b54
Fixed typo in tests/admin_views/test_history_view.py test name. 2020-12-18 09:23:22 +01:00
Hasan Ramezani 8d582bf510 Fixed #32262 -- Fixed migration optimization for model creation and Meta options removal. 2020-12-18 06:57:57 +01:00
Nick Pope bb64b99b78 Fixed #29867 -- Added support for storing None value in caches.
Many of the cache operations make use of the default argument to the
.get() operation to determine whether the key was found in the cache.
The default value of the default argument is None, so this results in
these operations assuming that None is not stored in the cache when it
actually is. Adding a sentinel object solves this issue.

Unfortunately the unmaintained python-memcached library does not support
a default argument to .get(), so the previous behavior is preserved for
the deprecated MemcachedCache backend.
2020-12-17 09:57:21 +01:00
David Smith 8f384505ee Refs #32273 -- Completed test coverage for AdminSite.unregister(). 2020-12-17 08:27:56 +01:00
Alexey Nigin b9ba85a7ce Fixed #32089 -- Fixed prefetch_related_objects() when some objects are already fetched.
Thanks Dennis Kliban for the report and Adam Johnson for the initial
patch.

Co-authored-by: Adam Johnson <me@adamj.eu>
2020-12-16 10:52:59 +01:00
Tom Forbes b5e12d490a Fixed #31007 -- Allowed specifying type of auto-created primary keys.
This also changes the default type of auto-created primary keys
for new apps and projects to BigAutoField.
2020-12-15 11:25:46 +01:00
Ayush Bansal b960e4ed72 Fixed #32261 -- Added error logging to Signal.send_robust(). 2020-12-15 11:00:26 +01:00
Mariusz Felisiak 965d2d95c6
Fixed typo in tests/servers/tests.py. 2020-12-15 08:51:58 +01:00
Petter Strandmark 772eca0b02 Fixed #32240 -- Made runserver suppress ConnectionAbortedError/ConnectionResetError errors.
See https://bugs.python.org/issue27682 and
https://github.com/python/cpython/pull/9713
2020-12-14 20:46:18 +01:00
Petter Strandmark 28124e7bdf Refs #4444 -- Added tests for handling broken pipe errors in WSGIServer. 2020-12-14 20:46:18 +01:00
Adam Johnson cf2ca22a57 Ensured that registered checks accept keyword arguments. 2020-12-14 18:08:37 +01:00
Tim Graham 5a434677a7
Relaxed MemSize test for CockroachDB. 2020-12-14 12:28:38 +01:00
Tim Graham 1e7653117f
Refs #32178 -- Fixed test_mark_expected_failures_and_skips_call teardown.
Test isolation failure observed on CockroachDB and PostgreSQL.
2020-12-11 21:06:33 +01:00
sage 8d7085e0fd Fixed #32252 -- Fixed __isnull=True on key transforms on SQLite and Oracle.
__isnull=True on key transforms should not match keys with NULL values.
2020-12-11 09:15:42 +01:00
Mariusz Felisiak 00a1d42bf0
Fixed isolation of test_runner.EmptyDefaultDatabaseTest.
This fixes test_runner.test_debug_sql.TestDebugSQL.
test_setupclass_exception when run in reverse.
2020-12-10 18:48:07 +01:00
Hasan Ramezani 275dd4ebba
Fixed #32178 -- Allowed database backends to skip tests and mark expected failures.
Co-authored-by: Tim Graham <timograham@gmail.com>
2020-12-10 18:00:57 +01:00
Mariusz Felisiak 5ce31d6a71
Fixed #32193 -- Deprecated MemcachedCache. 2020-12-09 21:27:32 +01:00
Florian Apolloner 98e05ccde4 Fixed #32233 -- Cleaned-up duplicate connection functionality. 2020-12-08 08:55:44 +01:00
Mariusz Felisiak 0f00560d45 Refs #32233 -- Added tests for nonexistent cache backend. 2020-12-08 08:54:54 +01:00
Mariusz Felisiak 30f2d1af03 Refs #32233 -- Added tests for nonexistent cache and databases aliases. 2020-12-08 08:54:50 +01:00
Tim Graham 406eb43112
Removed unused variable in runtests.py.
Unused since 1e72b1c5c1.
2020-12-07 07:08:27 +01:00