Commit Graph

11631 Commits

Author SHA1 Message Date
Tim Graham 406eb43112
Removed unused variable in runtests.py.
Unused since 1e72b1c5c1.
2020-12-07 07:08:27 +01:00
Timo Ludwig d8dfff2ab0 Fixed #32235 -- Made ReadOnlyPasswordHashField disabled by default. 2020-12-03 09:32:08 +01:00
Mariusz Felisiak d746f28949
Refs #27095 -- Fixed test_contained_by_including_F_object when run in reverse.
Tests should not rely on auto PKs.

Test regression in 33403bf80f.
2020-12-03 09:30:33 +01:00
Artur Beltsov 48b4bae983 Fixed #32179 -- Added JSONObject database function. 2020-12-02 09:30:50 +01:00
Tim Graham 371022a20d
Added SpatialFeatures.supports_tolerance_parameter. 2020-11-30 07:29:00 +01:00
Mariusz Felisiak 3828427f63 Refs #31978 -- Fixed hint in admin's password reset confirmation form for custom username fields.
Thanks Jaap Roes for the report.
2020-11-30 06:34:22 +01:00
Mariusz Felisiak 58740c0d7f Refs #22909 -- Removed camelCasing in auth_tests.test_templates tests. 2020-11-30 06:34:22 +01:00
Adam Johnson b9fd09d21b Fixed #32227 -- Prevented crash when setUpTestData() errors with --debug-sql.
Thanks Mariusz Felisiak for the report.
2020-11-28 12:22:59 +01:00
Giannis Adamopoulos 7603036bd0 Fixed #21021 -- Changed BaseGeometryWidget's default geometry type to 'Geometry'. 2020-11-28 09:14:40 +01:00
Giannis Adamopoulos 9175a2cc32 Added assertion for geom_type in BaseGeometryWidget.get_context(). 2020-11-28 09:14:40 +01:00
Mariusz Felisiak 931c6e982c Refs #32230 -- Made LayerMapping support pathlib.Path. 2020-11-28 07:41:54 +01:00
Hasan Ramezani b37be072a2 Fixed #32230 -- Made DataSource support pathlib.Path. 2020-11-28 07:36:19 +01:00
Ian Foote 3828879eee Fixed #32220 -- Added durable argument to transaction.atomic(). 2020-11-27 21:43:15 +01:00
Ian Foote 8b040e3cbb Fixed #25534, Fixed #31639 -- Added support for transform references in expressions.
Thanks Mariusz Felisiak and Simon Charette for reviews.
2020-11-27 20:42:04 +01:00
Hannes Ljungberg 33403bf80f Refs #27095 -- Allowed (non-nested) arrays containing expressions for ArrayField lookups. 2020-11-26 10:57:58 +01:00
Hannes Ljungberg 755b327552 Added test for ArrayField's __contains lookup with subqueries. 2020-11-26 09:36:00 +01:00
sage fe6e582421 Fixed #32203 -- Fixed QuerySet.values()/values_list() crash on key transforms with non-string values on SQLite.
Thanks Gordon Wrigley for the report.
2020-11-25 14:51:35 +01:00
sage 7408c4cd15 Refs #32203 -- Added tests for QuerySet.values()/values_list() on key transforms with non-trivial values. 2020-11-25 13:48:11 +01:00
Mariusz Felisiak f5e5aac59e
Fixed #32224 -- Avoided suppressing connection errors in supports_json_field on SQLite.`
Regression in 6789ded0a6.

Thanks Juan Garcia Alvite for the report.
2020-11-25 12:19:45 +01:00
Mariusz Felisiak bec415b290 Added test for filtering JSONField key transforms with quoted strings. 2020-11-24 18:11:19 +01:00
Daniel Hahler c70cd2a926 Refs #15053 -- Clarified debug message when skipping templates to avoid recursion. 2020-11-21 10:49:31 +01:00
Thibaud Colas a1215a3237 Fixed #32053 -- Fixed accessibility issues on the 'Congrats' page.
- Add lang attribute.
- Use the same text for the page’s main heading, and title.
- Add underlines for all links in copy.
- Stop using h2 for link to the Django page.
- Use h1 for the main heading.
- Remove useless type attribute on style element.
- Remove grey text that fails contrast checks.
- Use a shade of grey that passes AAA contrast requirements.
- Stop using h4 for footer links.
- Add full stop in block-level links so VoiceOver correctly pauses
  between runs of text.
- Hide main artwork for screen reader users.
- Update SVG icons markup to be screen-reader friendly.
- Switch options to be block-level links.
- Remove unused markup.
2020-11-20 19:18:07 +01:00
Florian Apolloner d10425f9c7 Simplified MessageEncoder instantiation with default separators. 2020-11-20 10:27:09 +01:00
Hasan Ramezani fe9c7ded29 Fixed #32200 -- Fixed grouping by ExpressionWrapper() with Q objects.
Thanks Gordon Wrigley for the report.

Regression in df32fd42b8.
2020-11-19 21:00:04 +01:00
Carlton Gibson ead37dfb58
Fixed #32202 -- Fixed autoreloader argument generation for Windows with Python 3.7-. 2020-11-19 12:07:15 +01:00
David-Wobrock ba42569d5c Fixed #31507 -- Added QuerySet.exists() optimizations to compound queries. 2020-11-16 20:29:13 +01:00
David-Wobrock 7b42d34646 Refs #27718 -- Doc'd and tested QuerySet.exists() for combined querysets.
Supported since 84c1826ded.
2020-11-16 15:15:41 +01:00
Hasan Ramezani 4cce1d13cf Fixed #32197 -- Improved error message when loading a database backend fails. 2020-11-16 06:05:03 +01:00
David-Wobrock 464a4c0c59 Fixed #31496 -- Fixed QuerySet.values()/values_list() crash on combined querysets ordered by annotations. 2020-11-14 10:22:09 +01:00
Nick Pope 477c800443
Changed docs and a code comment to use gender-neutral pronouns.
Follow up to e1b7723817.
2020-11-13 22:26:30 +01:00
Nick Pope fed8129276
Unified admin action description generation.
Actions added to AdminSite.actions would not have the first character
of their description capitalized.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-11-13 21:41:18 +01:00
manav014 f63f3cdf09 Fixed #29712 -- Made makemessages warn if locales have hyphens and skip them. 2020-11-13 09:25:42 +01:00
Tim Graham 8ed024b9b9
Refs #32120 -- Fixed test_add_inline_fk_index_update_data for DatabaseFeatures.indexes_foreign_keys.
This test creates an index with editor.add_index() so it's present
regardless of the database's behavior. Reverted the change from
ede9fac758.
2020-11-13 06:17:13 +01:00
Nick Pope 0cbccaebeb
Simplified TimeFormat.g(). 2020-11-12 15:19:17 +01:00
Sam 895f6e4992 Fixed #32149 -- Added support for years < 1000 to DateFormat.y(). 2020-11-12 12:43:06 +01:00
MinchinWeb f1585c54d0
Fixed #31216 -- Added support for colorama terminal colors on Windows.
Modern setups on Windows support terminal colors.
The colorama library may also be used, as an
alternative to the ANSICON library.
2020-11-11 14:27:10 +01:00
Artem Kosenko b7f500396e Fixed #31757 -- Adjusted system check for SECRET_KEY to warn about autogenerated default keys.
Thanks Nick Pope, René Fleschenberg, and Carlton Gibson for reviews.
2020-11-11 12:45:34 +01:00
Carles Pina i Estany 721c95ba0b Fixed #32180 -- Added system check for file system caches absolute location. 2020-11-11 11:04:52 +01:00
William Schwartz c0fc5ba380 Fixed #32183 -- Fixed shell crash when passing code with nested scopes. 2020-11-11 09:18:26 +01:00
Mariusz Felisiak d26d1c196d Refs #25680 -- Added shell tests for globals available in passed commands. 2020-11-11 09:17:20 +01:00
Hasan Ramezani 50c3ac6fa9 Fixed #31762 -- Made reloading the database for tests use the base manager.
Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
2020-11-11 08:33:30 +01:00
Tim Graham c9e8544321
Added SpatialFeatures.unsupported_geojson_options. 2020-11-11 07:39:15 +01:00
Claude Paroz 187482d743
Avoided direct styles in admin templates.
Direct styles might be forbidden by Content Security Policies.
2020-11-10 21:32:15 +01:00
Hasan Ramezani 4cd77f97a2 Refs #31672 -- Made technical 500 debug page include exceptions without tracebacks. 2020-11-10 13:21:50 +01:00
William Schwartz cc22693505 Fixed #32177 -- Made execute_from_command_line() use program name from the argv argument.
This caused crash in environments where sys.argv[0] is incorrectly set
to None.
2020-11-10 08:16:53 +01:00
Hannes Ljungberg 0773837e15 Fixed #32182 -- Fixed crash of JSONField nested key transforms with subquery annotations on PostgreSQL. 2020-11-10 07:09:58 +01:00
Tim Graham dbb4a86fa7 Renamed BaseSpatialOperations.geography to BaseSpatialFeatures.supports_geography. 2020-11-09 08:12:00 +01:00
Tim Graham 84ca7b8602
Removed hardcoded pks in migrations' test_alter_order_with_respect_to. 2020-11-07 20:26:01 +01:00
Craig Smith 6fa3d02f7f Refs #32045 -- Added tests for GenericRelatedObjectManager.clear()/remove(). 2020-11-06 11:31:21 +01:00
Hasan Ramezani 3f7b327562 Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.
This also replaces assertQuerysetEqual() to
assertSequenceEqual()/assertCountEqual() where appropriate.

Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-11-06 09:24:50 +01:00
Mariusz Felisiak 13b6fff117
Refs #31910 -- Fixed GeoQuerySetTest.test_geoagg_subquery() test on Oracle 18c. 2020-11-06 08:48:11 +01:00
Tom Forbes 658bcc16f1 Fixed #25791 -- Implement autoreload behaviour for cached template loader. 2020-11-05 15:30:52 +01:00
Tom Forbes 29845ecf69 Refs #25791 -- Added get_dirs() method to cached template loader. 2020-11-05 15:30:52 +01:00
Jon Dufresne 859cd7c6b4
Fixed #22276 -- Fixed crash when formset management form is invalid.
Co-authored-by: Patryk Zawadzki <patrys@room-303.com>
2020-11-05 10:40:41 +01:00
Christopher Keith 76181308fb
Fixed #31550 -- Adjusted ASGI test_file_response for various Windows content types. 2020-11-05 08:18:45 +01:00
Christopher Wang 2f6312fcd1 Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests. 2020-11-04 22:31:57 +01:00
Christopher Wang 77e93d3b20 Refs #32168 -- Fixed Publisher assertions in AggregationTests.test_more_more.
Refer to Publisher objects instead of Books.

Test regression in 1bf25e9bc6.
2020-11-04 22:31:57 +01:00
Artur Beltsov 18c8ced81e Fixed #32169 -- Added distinct support to JSONBAgg. 2020-11-04 21:22:54 +01:00
christa c36075ac1d Fixed #31983 -- Added system check for file system caches location.
Thanks Johannes Maron and Nick Pope for reviews.
2020-11-04 20:30:23 +01:00
Carlton Gibson ebb08d1942
Fixed #32159 -- Ensured AsyncRequestFactory correctly sets headers. 2020-11-04 11:07:15 +01:00
Simon Charette c2d4926702 Fixed #31910 -- Fixed crash of GIS aggregations over subqueries.
Regression was introduced by fff5186 but was due a long standing issue.

AggregateQuery was abusing Query.subquery: bool by stashing its
compiled inner query's SQL for later use in its compiler which made
select_format checks for Query.subquery wrongly assume the provide
query was a subquery.

This patch prevents that from happening by using a dedicated
inner_query attribute which is compiled at a later time by
SQLAggregateCompiler.

Moving the inner query's compilation to SQLAggregateCompiler.compile
had the side effect of addressing a long standing issue with
aggregation subquery pushdown which prevented converters from being
run. This is now fixed as the aggregation_regress adjustments
demonstrate.

Refs #25367.

Thanks Eran Keydar for the report.
2020-11-04 09:54:58 +01:00
Tim Graham 789c47e6de Removed hardcoded pk in defer_regress test. 2020-11-04 06:41:47 +01:00
Tim Graham 16adf4d6b1 Fixed GenericRelationTests.test_annotate when primary key values are large.
On CockroachDB, primary key values stored in this fields are larger
than they accept.
2020-11-04 06:41:48 +01:00
Tim Graham be27da9d6e Removed serial pk assumption in ordering tests.
Fixed OrderingTests.test_order_by_fk_attname and test_order_by_pk on
CockroachDB.
2020-11-03 22:26:18 -05:00
Mariusz Felisiak 009fddc96b
Refs #32061 -- Fixed test_crash_password_does_not_leak() crash on Windows.
When env is passed to subprocess.run() we should pass all existing
environment variables. This fixes crash on Windows:

Fatal Python error: failed to get random numbers to initialize Python

Fatal Python error: _Py_HashRandomization_Init: failed to get random
numbers to initialize Python
Python runtime state: preinitialized
2020-11-03 11:38:40 +01:00
Patrick Arminio 542b4b3ab4 Fixed #32162 -- Fixed setting Content-Length header in AsyncRequestFactory. 2020-11-03 10:12:40 +01:00
Tim Graham 92434bb0f5 Fixed DistinctOnTests.test_basic_distinct_on on CockroachDB. 2020-11-03 07:32:03 +01:00
Tim Graham f814fb6040 Removed serial pk assumption from FormfieldShouldDeleteFormTests.test_custom_delete. 2020-11-03 07:09:56 +01:00
Sicong 09e1ec71df
Fixed #32166 -- Removed redundant definition of Greatest in test_expression_on_aggregation. 2020-11-03 07:08:42 +01:00
David-Wobrock cfc7cd6513 Fixed #32132 -- Fixed column types in m2m intermediary tables for Positive(Big/Small)IntegerFields. 2020-11-02 20:11:58 +01:00
David-Wobrock 4ebd633350 Refs #32132 -- Added rel_db_type() tests for auto and integer fields. 2020-11-02 20:11:58 +01:00
Hasan Ramezani f06beea929 Fixed #32153 -- Fixed management commands when using required list options.
Thanks Mark Gajdosik for the report and initial patch.
2020-10-30 12:01:33 +01:00
Nick Pope 966b5b49b6 Updated MultiValueDict.update() to mirror dict.update() behavior.
Changes in behavior include:

- Accepting iteration over empty sequences, updating nothing.
- Accepting iterable of 2-tuples providing key-value pairs.
- Failing with the same or comparable exceptions for invalid input.

Notably this replaces the previous attempt to catch TypeError which was
unreachable as the call to .items() resulted in AttributeError on
non-dict objects.
2020-10-30 10:44:44 +01:00
Nick Pope c3d9b8b28f Increased test coverage for django.utils.datastructures.MultiValueDict.
Co-authored-by: Mads Jensen <mje@inducks.org>
2020-10-30 10:44:44 +01:00
Mads Jensen 825f8470f5 Increased test coverage for django.utils.datastructures.OrderedSet.
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2020-10-30 10:44:44 +01:00
Simon Charette 384ac0990f Refs #32061 -- Prevented password leak on MySQL dbshell crash.
The usage of the --password flag when invoking the mysql CLI has the
potential of exposing the password in plain text if the command happens
to crash due to the inclusion of args provided to
subprocess.run(check=True) in the string representation of the
subprocess.CalledProcessError exception raised on non-zero return code.

Since this has the potential of leaking the password to logging
facilities configured to capture crashes (e.g. sys.excepthook, Sentry)
it's safer to rely on the MYSQL_PWD environment variable instead even
if its usage is discouraged due to potential leak through the ps
command on old flavors of Unix.

Thanks Charlie Denton for reporting the issue to the security team.

Refs #24999.
2020-10-30 10:12:52 +01:00
Simon Charette eb25fdb620 Refs #32061 -- Added test for dbshell password leak on PostgreSQL. 2020-10-30 10:12:47 +01:00
Simon Charette bbe6fbb876 Refs #32061 -- Unified DatabaseClient.runshell() in db backends. 2020-10-29 22:22:58 +01:00
Christian Klus 4ac2d4fa42 Fixed #32152 -- Fixed grouping by subquery aliases.
Regression in 42c08ee465.

Thanks Simon Charette for the review.
2020-10-29 09:56:09 +01:00
Martin Thoma 302caa40e4 Made small readability improvements. 2020-10-28 20:20:20 +01:00
Hasan Ramezani 4eb756793b
Refs #28215 -- Marked auth credentials as sensitive variables.
Co-authored-by: Collin Anderson <collin@onetencommunications.com>
2020-10-28 14:21:53 +01:00
Jon Dufresne cee93c6ba1 Refs #25780 -- Removed redundant status code assertions from tests. 2020-10-28 12:26:49 +01:00
Simon Charette 8593e162c9 Fixed #32143 -- Used EXISTS to exclude multi-valued relationships.
As mentioned in the pre-existing split_exclude() docstring EXISTS is
easier to optimize for query planers and circumvents the IN (NULL)
handling issue.
2020-10-28 07:22:00 +01:00
Simon Charette bbf141bcdc Refs #27149 -- Fixed sql.Query identity.
By making Query subclass BaseExpression in
3543129822 the former defined it's
identity based off _construct_args which is not appropriate.
2020-10-28 07:21:53 +01:00
alvinshaita 556fa4bbba Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on multi-value relations. 2020-10-27 20:40:04 +01:00
Tim Graham c3b1e41288 Removed unneeded @no_oracle skips. 2020-10-27 07:14:16 +01:00
Tim Graham 7734337bcb Made OracleSpatialAdapter clone geometries rather than mutate them. 2020-10-27 07:14:16 +01:00
Tim Graham 49ece89702
Fixed some queries tests when primary key values are large.
On CockroachDB, primary key values stored in these fields are larger
than they accept. Fixes:
queries.test_bulk_update.BulkUpdateNoteTests.test_multiple_fields,
queries.test_bulk_update.BulkUpdateNoteTests.test_inherited_fields, and
queries.tests.RelatedLookupTypeTests.test_values_queryset_lookup.
2020-10-27 06:39:52 +01:00
Tim Graham 73be11a266
Removed an obsolete query test that assumes serial pks.
The code from the original fix (922aba3def)
was removed in 419de7b00d.
2020-10-27 06:31:26 +01:00
Hannes Ljungberg 10f8b82d19 Fixed #29497 -- Fixed loss of assigned parent when saving child with bulk_create() after parent. 2020-10-26 12:00:34 +01:00
Tim Graham 83a8da576d
Fixed admin_views's test_history_view on databases that don't use serial pks. 2020-10-26 10:44:55 +01:00
Jon Dufresne b2717c7532
Simplifed formset iteration using enumerate(). 2020-10-26 08:02:38 +01:00
Adam Johnson a56586eafe Fixed #32134 -- Fixed crash of __range lookup with namedtuple.
Regression in 8be79984dc.

Thanks Gordon Wrigley for the report.
2020-10-23 18:01:31 +02:00
Tim Graham 755dbf39fc Replaced @no_oracle skips with DatabaseFeatures.allows_group_by_lob. 2020-10-22 18:16:58 +02:00
Carlton Gibson ad11f5b8c9 Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior. 2020-10-22 14:15:19 +02:00
Mariusz Felisiak 3418092238
Fixed #32130 -- Fixed pre-Django 3.1 password reset tokens validation.
Thanks Gordon Wrigley for the report and implementation idea.

Regression in 226ebb1729.
2020-10-22 13:21:14 +02:00
Étienne Beaulé 509d9da26f Fixed #26390 -- Disabled grouping by Random().
Thanks to Tzu-ping Chung for the tests.
2020-10-21 20:54:53 +02:00
manav014 096b14f0ac Fixed #13060 -- Improved error message when ManagementForm data is missing. 2020-10-21 11:47:07 +02:00
Tom Carrick f5e07601b2 Fixed #32046 -- Added CreateCollation/RemoveCollation operations for PostgreSQL. 2020-10-21 10:53:44 +02:00
Jacob Walls 0362b0e986 Fixed #26615 -- Made password reset token invalidate when changing email.
Co-Authored-By: Silas Barta <sbarta@gmail.com>
2020-10-21 09:29:53 +02:00
Hannes Ljungberg 0e7a45fca0 Fixed #32126 -- Fixed grouping by Case() annotation without cases.
Co-authored-by: Simon Charette <charettes@users.noreply.github.com>
2020-10-21 07:22:52 +02:00
Octavio 4343430e9c Removed hardcoded pks in syndication tests. 2020-10-21 06:43:19 +02:00
Hannes Ljungberg f7963615eb Fixed #32121 -- Fixed detecting uniqueness of USERNAME_FIELD when using Meta.constraints.
Co-authored-by: Simon Charette <charettes@users.noreply.github.com>
2020-10-20 07:23:51 +02:00
Tim Graham ede9fac758
Fixed #32120 -- Added DatabaseFeatures.indexes_foreign_keys. 2020-10-20 06:22:56 +02:00
Herbert Poul c897b1587c Fixed #32108 -- Made transaction.on_commit() raise TypeError when callback is not a callable. 2020-10-19 20:46:13 +02:00
Mariusz Felisiak 0f18255848
Reverted "Reduced time.sleep() in cache touch() tests."
This reverts commit 177a49e79c
which caused more frequent failures of test_touch().
2020-10-19 19:54:23 +02:00
Tim Graham afcad0f1b1
Relaxed some query ordering assertions in expressions tests.
It accounts for differences seen on CockroachDB.
2020-10-19 19:21:31 +02:00
Hasan Ramezani 3b1746d519 Fixed #32107 -- Fixed ProtectedError.protected_objects and RestrictedError.restricted_objects.
Regression in 4ca5c565f4 and
ab3cbd8b9a.

Thanks Vitaliy Yelnik for the report.
2020-10-19 12:43:32 +02:00
Tim Graham 0eee5c1b9c
Added DatabaseFeatures.can_alter_geometry_field. 2020-10-19 12:41:52 +02:00
Hannes Ljungberg c7c7615d00 Fixed #32116 -- Fixed QuerySet.order_by() crash on EmptyQuerySet with union() on a single non-empty ordered queryset. 2020-10-19 08:36:07 +02:00
Tim Graham 78eeb24774
Made test_change_list_sorting_model_admin_reverse's assertions more specific.
The test could fail on databases like CockroachDB that use non-serial
primary keys if the numbers (2000, etc.) appeared in the pk values.
2020-10-18 19:48:06 +02:00
Claude Paroz 7f85498eef Fixed #32110 -- Doc'd and tested enumerations for ChoiceField.choices. 2020-10-17 20:30:57 +02:00
manav014 af87574a3c Fixed #6517 -- Made dbshell use charset option on MySQL.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-10-17 12:24:36 +02:00
Nick Pope 177a49e79c Reduced time.sleep() in cache touch() tests.
There are 8 cache backends to test and each test of touch() takes
~7s → ~56s. This seems excessive and it feels like we should be able
to reduce this significantly. time.sleep() accepts floating point
values and is guaranteed to sleep for at least the number of seconds
specified as of Python 3.5.

We do run the risk that there may be spurious test failures from this,
but that already seemed to be the case anyway.
2020-10-16 13:13:15 +02:00
Nick Pope be183fc94f Optimized inspectdb tests by specifying database tables/views. 2020-10-16 12:59:09 +02:00
Çağıl Uluşahin 9159d173c3 Fixed #25253 -- Made AlterField operation a noop when changing attributes that don't affect the schema. 2020-10-15 20:11:07 +02:00
Aarni Koskela 68e33b347d Fixed #32105 -- Added template paths as ExceptionReporter class attributes.
This allows replacement of the debugging templates without having to
copy-paste the `get_traceback_html` and `get_traceback_text` functions
into a subclass.

Thanks to Nick Pope for review.
2020-10-15 13:56:15 +02:00
Mariusz Felisiak 6e4f7ec854
Refs #31926 -- Made test_pickle_filteredrelation_m2m do not depend on auto-PK.
This caused failures on CockroachDB that use random rather than serial
pk values.
2020-10-15 08:17:42 +02:00
Mariusz Felisiak ee0abac169 Refs #32096 -- Fixed ExclusionConstraint crash with JSONField key transforms in expressions.
Regression in 6789ded0a6.
2020-10-14 20:56:04 +02:00
Mariusz Felisiak bbd55e5863 Refs #32096 -- Fixed ExpressionWrapper crash with JSONField key transforms.
Regression in 6789ded0a6.

Thanks Simon Charette and Igor Jerosimić for the report.
2020-10-14 20:56:04 +02:00
Mariusz Felisiak 7e1e198494 Refs #32096 -- Fixed __in lookup crash against key transforms for JSONField.
Regression in 6789ded0a6 and
1251772cb8.

Thanks Simon Charette and Igor Jerosimić for the report.
2020-10-14 20:56:04 +02:00
Mariusz Felisiak 1f31027bb3 Refs #32096 -- Fixed crash of ArrayAgg/StringAgg/JSONBAgg with ordering over JSONField key transforms.
Regression in 6789ded0a6.

Thanks Igor Jerosimić for the report.
2020-10-14 20:56:04 +02:00
Mariusz Felisiak 1d650ad019 Refs #32096 -- Added test for ArrayAgg over JSONField key transforms. 2020-10-14 20:56:04 +02:00
Mariusz Felisiak 7bfdd3b951 Refs #32096 -- Added test for window expressions with JSONField key transforms. 2020-10-14 20:56:04 +02:00
David-Wobrock ee005328c8 Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a specific timezone. 2020-10-14 20:06:26 +02:00
David-Wobrock 8d018231ac Removed redundant tests in test_extract_trunc.
tzinfo is ignored for DateFields and TimeFields, and it's already
covered by DateFunctionTests.test_trunc_func().
2020-10-14 20:03:44 +02:00
David-Wobrock a0571c1003 Refs #31640 -- Made Extract raise ValueError when using tzinfo with Date/TimeField. 2020-10-14 20:03:07 +02:00
Jacob Walls ac6c426007 Fixed #20601 -- Allowed forcing format with thousand separators in floatformat filter.
Thanks Claude Paroz and Nick Pope for reviews.
2020-10-13 10:36:46 +02:00
Octavio 746bb13ceb Fixed #22490 -- Added tests for Feed.get_object(). 2020-10-13 07:16:07 +02:00
Hasan Ramezani 78ae8cc5d8 Fixed #31674 -- Fixed displaying traceback in technical 500 debug page.
Previously, the technical 500 debug page didn't contain a traceback
when the exception chain contained an exception without traceback.

Thanks Chris Jerdonek for the report.
2020-10-12 10:25:36 +02:00
nik258heda 079deba530 Fixed #32087 -- Made technical 500 debug page use HTTPS for sharing traceback. 2020-10-12 06:29:36 +02:00
Thomas Riccardi f1f24539d8 Fixed #32094 -- Fixed flush() calls on management command self.stdout/err proxies. 2020-10-09 12:59:00 +02:00
Tim Schilling b7da588e88 Fixed #32091 -- Fixed admin search bar width on filtered admin page. 2020-10-09 11:39:22 +02:00
Qi Zhao de81676b51 Fixed #32080 -- Fixed displaying Unicode chars in forms.JSONField and read-only JSONField values in admin. 2020-10-09 08:14:17 +02:00
Julien Rebetez b790883065 Fixed #31181 -- Added links to related models for admin's readonly fields. 2020-10-08 19:53:49 +02:00
Tom Carrick dcb69043d0 Fixed #32002 -- Added headers parameter to HttpResponse and subclasses. 2020-10-07 09:19:57 +02:00
Tom Carrick 2e7cc95499 Refs #32002 -- Added tests for HttpResponse's content_type parameter. 2020-10-07 09:19:57 +02:00
Max Smolens 07a30f5616 Fixed #31850 -- Fixed BasicExtractorTests.test_extraction_warning with xgettext 0.21+.
"format string with unnamed arguments cannot be properly localized"
warning is not raised in xgettext 0.21+.

This patch uses a message that causes an xgettext warning regardless of
the version.
2020-10-07 06:40:42 +02:00
Bob Renwick 036f160733 Refs #20577 -- Deferred filtering of prefetched related querysets by reverse m2o relation. 2020-10-06 21:19:56 +02:00
Mariusz Felisiak 999cddd58d
Fixed #32073 -- Skipped collation tests on PostgreSQL < 10.
PostgreSQL < 10 doesn't support ICU collations.

Thanks Hannes Ljungberg for the report.
2020-10-06 12:51:35 +02:00
Mariusz Felisiak fce389af7c
Skipped GetImageDimensionsTests.test_webp when WEBP is not installed. 2020-10-06 11:25:04 +02:00
Hasan Ramezani efe74fff25 Refs #32047 -- Added test for using call_command() with constant required options. 2020-10-06 08:23:25 +02:00
Simon Charette 0ef04fdd7a Refs #31926 -- Fixed reverse related identity crash on Q() limit_choices_to. 2020-10-05 20:47:51 +02:00
Simon Charette 4c675523bd Refs #29838, Refs #28507 -- Made make_hashable() ignore key order. 2020-10-05 20:42:46 +02:00
Hasan Ramezani 981a3426cf Fixed #32068 -- Added error messages on get() with filters following union(), intersection(), and difference(). 2020-10-05 12:25:05 +02:00
Hasan Ramezani 7cfa40d872 Refs #32068 -- Added tests for get() following union(), intersection(), and difference(). 2020-10-05 12:25:02 +02:00
David-Wobrock c32d8f33d8 Fixed #31926 -- Fixed recreating queryset with FilteredRelation when using a pickled Query.
In a pickled join, the join_fields had the same values, but weren't the
same object (contrary to when not pickling the QuerySet).
2020-10-05 10:07:34 +02:00
Nick Pope 06c5d3fafc Fixed #32060 -- Added Random database function. 2020-10-02 06:58:03 +02:00
Thibaud Colas d6d007819d Fixed typo in tests/view_tests/tests/test_debug.py docstring. 2020-10-01 13:08:25 +02:00
Hasan Ramezani 6eb3f53bdd Fixed #32047 -- Fixed call_command() crash if a constant option from required mutually exclusive group is passed in options. 2020-09-30 20:10:38 +02:00
aryan 11c4a4412b Fixed #30422 -- Made TemporaryFileUploadHandler handle interrupted uploads.
This patch allows upload handlers to handle interrupted uploads.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-09-30 10:30:43 +02:00
aryan 21b127bfbc Refs #30422 -- Added test for removing temporary files in MultiPartParser when StopUpload is raised. 2020-09-30 10:29:08 +02:00
David Wobrock 058747b77a Fixed #31880 -- Made QuerySet.aggregate() raise FieldError when aggregating over aggregation aliases. 2020-09-29 09:04:25 +02:00
Jacob Walls 01a7af09b9 Fixed #18995 -- Made blocktranslate tag raise TemplateSyntaxError when plural count is not a number. 2020-09-29 08:03:51 +02:00
meghanabhange 848770dd2c Fixed #32042 -- Improved error messages for the number of submitted forms in formsets. 2020-09-28 07:05:34 +02:00
David Smith b8239cae19 Refs #28009 -- Added empty_value tests for CharField subclasses. 2020-09-25 12:33:54 +02:00
David Smith 997f87c5b0 Added assertions for cleaning None values for forms.JSONField and forms.UUIDField. 2020-09-25 10:12:01 +02:00
David Smith 4b032142fa Used assertRaisesMessage() in CharField tests. 2020-09-25 10:12:01 +02:00
Mariusz Felisiak e4ab44a4b2 Fixed #32038 -- Fixed EmptyFieldListFilter crash with GenericRelation.
Thanks Javier Matos Odut for the report.
2020-09-25 10:09:28 +02:00
David Smith 599f2f79e2 Fixed #30563 -- Optimized form Media by removing duplicated assets when adding. 2020-09-24 13:53:06 +02:00
David Smith 1ac337cca6 Refs #30563 -- Added tests for merging form Media with different ordering. 2020-09-24 13:53:02 +02:00
Jacob Walls e26a7a8ef4 Fixed #27906 -- Fixed test tools counting of HTML matches for subsets of elements.
Previously examples such as '<a/><b/>' would not match in '<a/><b/><c/>'.
2020-09-24 12:52:41 +02:00
Mariusz Felisiak 77caeaea88
Fixed #32012 -- Made test database creation sync apps models when migrations are disabled.
Thanks Jaap Roes for the report.
2020-09-23 10:54:04 +02:00
Raffaele Salmaso 666f2e8acd Refs #32034 -- Added test for title on admin app index view. 2020-09-23 10:01:03 +02:00
Hasan Ramezani 71d10ca8c9 Fixed #31723 -- Fixed window functions crash with DecimalField on SQLite.
Thanks Simon Charette for the initial patch.
2020-09-23 09:35:32 +02:00
Mariusz Felisiak 75d7af43c1
Corrected docstring quotes in various code. 2020-09-22 10:30:53 +02:00
Mariusz Felisiak f7806193e6
Made indexes tests use required_db_features. 2020-09-22 10:29:59 +02:00
Tom Carrick e387f191f7 Fixed #31777 -- Added support for database collations to Char/TextFields.
Thanks Simon Charette and Mariusz Felisiak for reviews.
2020-09-21 18:24:56 +02:00
Tom Carrick 278b6187d2 Refs #21181 -- Corrected DatabaseFeatures.test_collations for Swedish collation.
Previously, backends used different keys "swedish-ci" or "swedish_ci".
2020-09-18 12:15:46 +02:00
Hasan Ramezani a046bcadbe
Fixed #31916 -- Fixed combined queryset crash when combining with ordered combined querysets. 2020-09-17 08:26:06 +02:00
Kwist 981a072dd4 Fixed #31843 -- Fixed pickling named values from QuerySet.values_list(). 2020-09-16 13:43:06 +02:00
Mariusz Felisiak 3a9f192b13
Refs #32007 -- Skipped test_q_expression_annotation_with_aggregation on Oracle. 2020-09-16 11:47:02 +02:00
Nick Pope b4d46df5ca Fixed #29887 -- Added a cache backend for pymemcache. 2020-09-16 09:40:30 +02:00
Nick Pope cda0a3d777 Refs #29887, Refs #24212 -- Added more client servers tests for PyLibMCCache. 2020-09-16 07:38:32 +02:00
Mariusz Felisiak eaf9764d3b
Fixed #32007 -- Fixed queryset crash with Q() annotation and aggregation.
Thanks Gordon Wrigley for the report.

Regression in 8a6df55f2d.
2020-09-15 11:40:59 +02:00
Hasan Ramezani 7be6a6a4d6 Fixed #31989 -- Fixed return value of django.core.files.locks.lock()/unlock() on POSIX systems. 2020-09-15 10:21:26 +02:00
manav014 580a4341cb Fixed #31636 -- Made BooleanFieldListFilter respect Field.choices. 2020-09-15 09:12:14 +02:00
Tim Graham fed257ddff Prevented creation of 3D test models if not supported.
There's no problem creating the models on MySQL and Oracle
(which don't support 3D storage) but CockroachDB currently
crashes with a syntax error.
2020-09-15 07:48:48 +02:00
Mariusz Felisiak e11d05e0b4
Fixed #31990 -- Fixed QuerySet.ordered for GROUP BY queries on models with Meta.ordering.
Regression in 0ddb4ebf7b.

Thanks Julien Dutriaux for the report.
2020-09-14 20:07:44 +02:00
Alexander Todorov 5fab16392f
Fixed #32003 -- Added obj argument to has_perm() methods in tests. 2020-09-14 12:28:17 +02:00
Tom Carrick bcc2befd0e Fixed #31789 -- Added a new headers interface to HttpResponse. 2020-09-14 08:41:59 +02:00
Tim Graham 71ae1ab012
Removed hardcoded paths to SpatialRefSys models in tests. 2020-09-14 07:58:05 +02:00
Tim Graham a7a4ff1026
Refs #26697 -- Removed empty gis_tests.maps. 2020-09-14 07:48:47 +02:00
Mariusz Felisiak 3b8857b51a Corrected tests.backends.sqlite.tests.Tests.test_aggregation()'s docstring. 2020-09-13 20:09:44 +02:00
Barton Ip 12d6cae7c0 Fixed #31766 -- Made GDALRaster.transform() return a clone for the same SRID and driver.
Thanks Daniel Wiesmann for the review.
2020-09-11 10:31:38 +02:00
Hasan Ramezani 5362e08624 Fixed #31943 -- Fixed recreating QuerySet.values()/values_list() when using a pickled Query. 2020-09-11 07:58:52 +02:00
Jon Dufresne 84609b3205 Fixed #31993 -- Added subtitles to admin change/view pages. 2020-09-11 06:28:45 +02:00
Jon Dufresne cbe34dc8ec Refs #31993 -- Added more titles assertions for admin views. 2020-09-10 13:21:08 +02:00
Jon Dufresne 53c0d16ac1
Fixed #31992 -- Made admin password reset templates use title/content_title blocks from the base template. 2020-09-10 11:53:09 +02:00
Jacob Walls 1db8d8e3a9 Refs #23130 -- Added test for BooleanField choices generation. 2020-09-10 11:42:06 +02:00
Ryan Hiebert 502e75f9ed Fixed #31750 -- Made models.Field equality compare models for inherited fields. 2020-09-09 20:52:59 +02:00
Hasan Ramezani 2808cdc8fb Fixed #31962 -- Made SessionMiddleware raise SessionInterrupted when session destroyed while request is processing. 2020-09-09 09:04:28 +02:00
Petr Čermák fc1446073e Fixed #31987 -- Fixed Cast() with DurationField on MySQL. 2020-09-09 07:01:18 +02:00
François Freitag 57dadfac3c Fixed #31944 -- Used addCleanup() to register TestContextDecorator cleanups.
Cleanups from addCleanup() are scheduled to happen in reverse order to
the order they are added (LIFO). Ensures each cleanup is executed from
the innermost to the outermost.
2020-09-07 08:07:26 +02:00
Jon Dufresne 11ebc6479f Fixed #31791 -- Made technical 404 debug page display the tried URL patterns for Http404. 2020-09-07 06:54:19 +02:00
Hasan Ramezani d2d08c8cf6 Fixed #31982 -- Made HttpResponse.set_cookie() cast max_age argument to an integer. 2020-09-05 10:07:23 +02:00
Mariusz Felisiak e6b5108acc
Fixed #27417 -- Made RenameField operation a noop for field name case changes on Oracle.
Field names are always uppercased in the Oracle backend. Changing case
should be a noop to avoid database errors: "ORA-00957: duplicate column
name".
2020-09-04 20:27:23 +02:00
jpribyl 94e2238107 Refs #31894 -- Added tests for JSONField key lookups with QuerySet.exclude(). 2020-09-04 09:04:24 +02:00
Nick Pope fd209f62f1 Refs #21231 -- Backport urllib.parse.parse_qsl() from Python 3.8. 2020-09-03 14:24:42 +02:00
Collin Anderson daa26acc4e Fixed #31978 -- Added username hint to admin's password reset confirmation form. 2020-09-03 09:25:21 +02:00
Mariusz Felisiak 6a881197e9
Refs #31901 -- Fixed SeleniumTests.test_list_editable_popups with headless mode. 2020-09-02 15:16:03 +02:00
Brian Helba 2d42e23b6d Fixed #31941 -- Corrected FileField.deconstruct() with a callable storage. 2020-09-02 11:06:18 +02:00
Tim Park ece18207cb Fixed #31858 -- Reallowed whitespaces in URL paths outside of parameters.
Regression in 22394bd3a1.

Thanks David Smith for the review.
2020-09-02 10:24:14 +02:00
Nick Pope a629139425 Refs #29887, Refs #24212 -- Added servers configuration hook for memcached backends.
The servers property can be overridden to allow memcached backends to
alter the server configuration prior to it being passed to instantiate
the client. This allows avoidance of documentation for per-backend
differences, e.g. stripping the 'unix:' prefix for pylibmc.
2020-09-02 08:51:17 +02:00
Joe Jackson 9d5d865fd6 Fixed #31948 -- Added tzinfo parameter to TruncDate() and TruncTime(). 2020-09-02 07:42:27 +02:00
Nick Pope cc1f2c6a19 Refs #29887 -- Simplified memcached client instantiation. 2020-09-01 10:51:00 +02:00
Mariusz Felisiak 1853724aca Fixed CVE-2020-24584 -- Fixed permission escalation in intermediate-level directories of the file system cache on Python 3.7+. 2020-09-01 09:17:23 +02:00
Mariusz Felisiak 8d7271578d Fixed CVE-2020-24583, #31921 -- Fixed permissions on intermediate-level static and storage directories on Python 3.7+.
Thanks WhiteSage for the report.
2020-09-01 09:17:23 +02:00
Federico Jaramillo Martínez 179d9dc0c2 Fixed #31952 -- Fixed EmptyFieldListFilter crash with reverse relationships.
Thanks dacotagh for the report.
2020-08-31 09:28:05 +02:00
Simon Charette f6405c0b8e Fixed #31965 -- Adjusted multi-table fast-deletion on MySQL/MariaDB.
The optimization introduced in 7acef095d7 did not properly handle
deletion involving filters against aggregate annotations.

It initially was surfaced by a MariaDB test failure but misattributed
to an undocumented change in behavior that resulted in the systemic
generation of poorly performing database queries in 5b83bae031.

Thanks Anton Plotkin for the report.

Refs #23576.
2020-08-31 08:11:28 +02:00
Simon Charette 38fce49c82 Fixed #31919 -- Resolved output_field of IntegerField subclasses combinations. 2020-08-31 06:42:40 +02:00
Simon Charette 40894f2967 Refs #30446 -- Added tests for resolving output_field of CombinedExpression. 2020-08-31 06:40:39 +02:00
Mariusz Felisiak 0be51d2226 Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder on PostgreSQL.
Thanks Marc Debureaux for the report.
Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
2020-08-28 19:09:46 +02:00
Mariusz Felisiak 2210539142 Refs #31956 -- Added test for ordering by JSONField with a custom decoder. 2020-08-28 19:09:41 +02:00
Koen De Wit 4c0b4720b0 Fixed #31954 -- Fixed migration optimization for MTI model creation with parent model with mixed case app label. 2020-08-28 13:35:13 +02:00
Kevin Michel 225261b701 Refs #31928 -- Added various middlewares tests for detecting when get_response is coroutine. 2020-08-28 12:33:29 +02:00
Kevin Michel 825ce75fae Fixed #31928 -- Fixed detecting an async get_response in various middlewares.
SecurityMiddleware and the three cache middlewares were not calling
super().__init__() during their initialization or calling the required
MiddlewareMixin._async_check() method.

This made the middlewares not properly present as coroutine and
confused the middleware chain when used in a fully async context.

Thanks Kordian Kowalski for the report.
2020-08-28 12:33:15 +02:00
Kevin Michel 68d7cf4054 Refs #26601 -- Added various middlewares tests for deprecation of passing None as get_response. 2020-08-28 12:33:15 +02:00
Kevin Michel abbdd3a622 Added tests for cache middlewares constructors. 2020-08-28 10:00:39 +02:00
Mariusz Felisiak 1251772cb8
Fixed #31936 -- Fixed __in lookup on key transforms for JSONField.
This resolves an issue on databases without a native JSONField
(MariaDB, MySQL, SQLite, Oracle), where values must be wrapped.

Thanks Sébastien Pattyn for the report.
2020-08-26 22:13:37 +02:00
Jeremy Lainé 9c92924cd5 Fixed #31942 -- Made settings cleansing work with dictionary settings with non-string keys. 2020-08-26 11:59:37 +02:00
Kaustubh b9be11d442 Fixed #31918 -- Allowed QuerySet.in_bulk() to fetch on a single distinct field. 2020-08-26 09:43:39 +02:00
Michael Galler 547a07fa7e Fixed #31905 -- Made MiddlewareMixin call process_request()/process_response() with thread sensitive.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2020-08-26 07:13:49 +02:00
Tim Graham ea880ec233 Fixed #24533 -- Dropped PostgreSQL sequence and Oracle identity when migrating away from AutoField. 2020-08-24 14:32:07 +02:00
Nick Pope b312421511
Refs #30897 -- Added test for WAL option to Queryset.explain() on PostgreSQL 13+. 2020-08-24 11:47:38 +02:00
Mariusz Felisiak bb8f66934d Fixed #31877 -- Reverted "Fixed #19878 -- Deprecated TemplateView passing URL kwargs into context."
This reverts commit 4ed534758c.
2020-08-24 11:37:59 +02:00
Mariusz Felisiak 04e87e79a0 Refs #31877 -- Reverted "Fixes #31877 -- Used lazy() for TemplateView kwarg deprecation warning."
This reverts commit 20799cc0a6.
2020-08-24 11:37:59 +02:00
Nick Pope b5acb9db75 Fixed #31907 -- Fixed missing validate_key() calls in cache backends. 2020-08-24 09:41:21 +02:00
Nick Pope 9e04b242ee Refs #31907 -- Added cache key validation tests for cache operations. 2020-08-24 09:33:55 +02:00
Tim Graham 7ca42974ee
Added assertions for the results of migrating an integer pk to AutoField. 2020-08-24 06:45:48 +02:00
Mariusz Felisiak 4376c2c7f8
Fixed #31895 -- Fixed crash when decoding invalid session data.
Thanks Matt Hegarty for the report.
Regression in d4fff711d4.
2020-08-19 12:06:00 +02:00
Maxim Petrov bf6d07730c Fixed #31902 -- Fixed crash of ExclusionConstraint on expressions with params. 2020-08-19 06:43:54 +02:00
Mariusz Felisiak 35b03788b0 Refs #9061 -- Allowed GenericInlineFormSet to disable deleting extra forms.
Follow up to 162765d6c3.
2020-08-18 09:37:15 +02:00
Mariusz Felisiak 3254991762 Refs #20347 -- Allowed customizing the maximum number of instantiated forms in generic_inlineformset_factory().
Follow up to 433dd737f9.
2020-08-18 09:37:15 +02:00
Ahmad A. Hussein 493b26bbfc Fixed #31888 -- Avoided module-level MySQL queries in tests. 2020-08-17 09:31:16 +02:00
Iuri de Silvio 632ccffc49 Fixed #31826 -- Made AlterField operation a noop when adding db_column.
AlterField operation with adding a db_column is a noop if the column
name is not changed.
2020-08-14 13:13:36 +02:00
Yan Mitrofanov b88f98738f Fixed #31878 -- Made createsuperuser respect --database option in default usernames. 2020-08-14 11:08:20 +02:00
Yan Mitrofanov 552bb82928 Fixed typo in tests/auth_tests/test_management.py docstring. 2020-08-14 11:08:12 +02:00
Ahmad A. Hussein 61a0ba43cf Refs #31811 -- Added optional timing outputs to the test runner. 2020-08-13 17:17:15 +02:00
Simon Charette 51297a9232 Fixed #31792 -- Made Exists() reuse QuerySet.exists() optimizations.
The latter is already optimized to limit the number of results, avoid
selecting unnecessary fields, and drop ordering if possible without
altering the semantic of the query.
2020-08-13 14:10:36 +02:00
Iuri de Silvio 7f4c9222df Fixed #31825 -- Made RenameField operation a noop for fields with db_column. 2020-08-13 13:14:58 +02:00
Adam Johnson 20799cc0a6 Fixes #31877 -- Used lazy() for TemplateView kwarg deprecation warning.
SimpleLazyObjects cause a crash when filtering.

Thanks Tim L. White for the report.
Regression in 4ed534758c.
2020-08-13 07:26:10 +02:00
Pat Garcia 8954f255bb Fixed #31382 -- Made Model.save(update_fields=...) raise ValueError on non-concrete fields. 2020-08-12 21:13:55 +02:00
Gert Burger 94ea79be13 Fixed #31863 -- Prevented mutating model state by copies of model instances.
Regression in bfb746f983.
2020-08-12 12:43:42 +02:00
Tom Carrick 63300f7e68 Fixed #21181 -- Added Collate database function.
Thanks Simon Charette for reviews.
2020-08-11 22:21:08 +02:00
Daniel Hillier 60626162f7 Fixed #31866 -- Fixed locking proxy models in QuerySet.select_for_update(of=()). 2020-08-11 11:55:10 +02:00
Carlton Gibson 0aeb802cf0 Fixed #31865 -- Adjusted admin nav sidebar template to reduce debug logging.
Thanks to Mariusz Felisiak for review.
2020-08-11 11:42:15 +02:00
Mariusz Felisiak 287e36bd22
Refs #31180 -- Fixed unreachable assertions in apps tests. 2020-08-11 10:31:09 +02:00
Iuri de Silvio ebd78a9f97
Fixed #31870 -- Fixed crash when populating app registry with empty or without apps module.
Regression in 3f2821af6b.
2020-08-10 20:16:45 +02:00
Iuri de Silvio 58a336a674 Fixed #31831 -- Fixed migration operations ordering when adding order_with_respect_to and constraints/indexes. 2020-08-08 20:43:45 +02:00
Iuri de Silvio 366a93f174 Refs #31831 -- Added autodector test for unique/index_together on _order field. 2020-08-08 20:43:40 +02:00
Mariusz Felisiak 99abfe8f4d
Fixed #31864 -- Fixed encoding session data during transition to Django 3.1.
Thanks אורי for the report.
2020-08-07 21:42:39 +02:00
Konstantin Alekseev e5118b545b Used mock.Mock() in SMTPBackendTests.
Using bool caused mypy typecheck failures.
2020-08-07 20:31:47 +02:00
Nick Pope 0a306f7da6 Fixed #25513 -- Extracted admin pagination to Paginator.get_elided_page_range(). 2020-08-06 12:38:56 +02:00
Nick Pope f35840c196 Refs #25513 -- Fixed admin pagination elision bounds.
It doesn't make sense to elide a single page number which could be a
clickable link to that page. We only want to elide two or more pages.
2020-08-06 12:38:56 +02:00
Nick Pope b203ec70fd Refs #25513 -- Adjusted admin pagination to be 1-indexed. 2020-08-06 12:38:56 +02:00
Jacob Walls c7e7f176c1 Fixed #26977 -- Made abstract models raise TypeError when instantiating. 2020-08-05 06:37:04 +02:00
Mariusz Felisiak d907371ef9 Fixed #31842 -- Added DEFAULT_HASHING_ALGORITHM transitional setting.
It's a transitional setting helpful in migrating multiple instance of
the same project to Django 3.1+.

Thanks Markus Holtermann for the report and review, Florian
Apolloner for the implementation idea and review, and Carlton Gibson
for the review.
2020-08-04 09:35:24 +02:00
Mariusz Felisiak 7c929fcf7c
Refs #27468 -- Fixed TestSigner.test_dumps_loads_legacy_signature.
Added in 1d6fdca557.
2020-08-01 20:39:18 +02:00
Mariusz Felisiak 1d6fdca557 Refs #27468 -- Added tests and release notes for signing.dumps()/loads() changes.
Follow up to 71c4fb7beb.
2020-07-31 22:05:02 +02:00
Alexandr Tatarinov f4ac167119 Fixed #27719 -- Added QuerySet.alias() to allow creating reusable aliases.
QuerySet.alias() allows creating reusable aliases for expressions that
don't need to be selected but are used for filtering, ordering, or as
a part of complex expressions.

Thanks Simon Charette for reviews.
2020-07-31 13:19:33 +02:00
Mariusz Felisiak 88af11c58b
Refs #27996 -- Fixed postgres_tests crash if not running with PostgreSQL. 2020-07-31 12:38:09 +02:00
David Smith e74b3d724e Bumped minimum isort version to 5.1.0.
Fixed inner imports per isort 5.
isort 5.0.0 to 5.1.0 was unstable.
2020-07-30 10:58:59 +02:00
Viktor Garske 1173db4a16 Fixed #31822 -- Added support for comments URL per feed item.
The item_comments hook returns a comments URL which is then used by the
feed builder.
2020-07-30 07:36:27 +02:00
Tim Graham 184a6eebb0
Refs #31829 -- Added DatabaseFeatures.json_key_contains_list_matching_requires_list.
CockroachDB's behavior matches PostgreSQL.
2020-07-30 06:38:02 +02:00
David Smith 95da207bdb Fixed #28507 -- Made ValidationError.__eq__() ignore messages and params ordering.
Co-authored-by: caleb logan <clogan202@gmail.com>
2020-07-29 12:04:13 +02:00
Florian Demmer 16218c2060 Fixed #27395 -- Added sitemap 'alternates' generation.
Updated the sitemap generator and default template to optionally
include link elements with hreflang attribute to alternate language
URLs.
2020-07-29 11:48:29 +02:00
Carlton Gibson 50e1ccbbea Refs #27395 -- Added XML namespace declaration to sitemap template.
As per Google recommendations:
https://support.google.com/webmasters/answer/189077?hl=en
2020-07-29 11:48:29 +02:00
Florian Apolloner 948a874425
Fixed #29324 -- Made SECRET_KEY validation lazy (on first access). 2020-07-29 09:06:54 +02:00
Hasan Ramezani 9c9a3fe118 Fixed #31783 -- Fixed crash when filtering againts "negate" field.
Thanks Simon Charette for the initial patch.
2020-07-29 08:20:58 +02:00
David Smith b6dfdaff33 Completed test coverage for colorize(). 2020-07-29 07:57:06 +02:00
sage 2d8dcba03a Fixed #31829 -- Used JSONField __contains lookup on key transforms. 2020-07-28 13:10:12 +02:00
Mariusz Felisiak ba691933ce
Fixed #31836 -- Dropped support for JSONField __contains and __contained_by lookups on SQLite.
The current implementation works only for basic examples without
supporting nested structures and doesn't follow "the general principle
that the contained object must match the containing object as to
structure and data contents, possibly after discarding some
non-matching array elements or object key/value pairs from the
containing object".
2020-07-28 13:06:52 +02:00
Mariusz Felisiak 02447fb133
Fixed #31835 -- Dropped support for JSONField __contains lookup on Oracle.
The current implementation works only for basic examples without
supporting nested structures and doesn't follow "the general principle
that the contained object must match the containing object as to
structure and data contents, possibly after discarding some
non-matching array elements or object key/value pairs from the
containing object".
2020-07-28 11:54:01 +02:00
Nick Pope 628c4a26ee Refs #27996 -- Doc'd no extension required for RandomUUID() on PostgreSQL 13+.
https://www.postgresql.org/docs/13/functions-uuid.html
https://www.postgresql.org/docs/13/pgcrypto.html#id-1.11.7.34.10.5
2020-07-28 07:21:16 +02:00
Jon Dufresne 83fbaa9231 Fixed #31806 -- Made validators include the value in ValidationErrors. 2020-07-27 13:03:26 +02:00
Jon Dufresne 013e06bb37 Refs #31806 -- Added tests for including the value in some ValidationErrors. 2020-07-27 13:03:19 +02:00
Mariusz Felisiak f4e93919e4
Fixed #31815 -- Fixed schema value encoding on PostgreSQL. 2020-07-27 06:39:02 +02:00
Matthias Kestenholz c1f8d87bb0 Fixed #31812 -- Fixed FileField.model for fields defined in abstract models.
Regression in a93425a37f.
2020-07-24 11:06:57 +02:00
Parth Verma 41065cfed5 Fixed #31802 -- Added system check for non-integer SITE_ID. 2020-07-24 10:41:55 +02:00
Mariusz Felisiak fd53db842c
Fixed #31805 -- Fixed SchemaTests.tearDown() when table names are case-insensitive. 2020-07-22 12:49:56 +02:00
Mariusz Felisiak c071c408d7
Fixed #31797 -- Skipped schema tests on specific MariaDB versions.
test_alter_not_unique_field_to_primary_key() test is affected by
https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1.

test_alter_pk_with_self_referential_field() test is affected by
https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series
from 10.4.13.
2020-07-22 10:57:38 +02:00
Tim Graham ff55adbd0d
Reverted "Fixed #30300 -- Allowed migrations to be loaded from directories without __init__.py file."
This reverts commit 3cd3bebe89.
2020-07-22 07:04:06 +02:00
Aymeric Augustin 3f2821af6b
Fixed #31180 -- Configured applications automatically. 2020-07-21 10:35:12 +02:00
David Chorpash 6ec5eb5d74 Refs #31720 -- Defined default output_field of BoolAnd() and BoolOr() aggregate functions. 2020-07-21 06:42:51 +02:00
Jon Dufresne 796be5901a Fixed #31769 -- Improved default naming of merged migrations.
47 gives 60 in total (47 + 5 + 5 + 3).
2020-07-20 15:04:22 +02:00
Jon Dufresne e1e4fd707f
Used context manager version of tempfile.TemporaryDirectory() in utils_tests.test_autoreload. 2020-07-20 11:08:23 +02:00
Mariusz Felisiak 83f55aafdd
Fixed #17653 -- Allowed using zero as AutoFields value on MySQL if NO_AUTO_VALUE_ON_ZERO SQL mode is enabled. 2020-07-20 09:48:31 +02:00
Tom Forbes 730711e828 Used temporary directory in RestartWithReloaderTests.test_manage_py().
Using the current directory can cause a PermissionError.
2020-07-20 09:16:16 +02:00
Florian Apolloner 96a3ea39ef Fixed #31784 -- Fixed crash when sending emails on Python 3.6.11+, 3.7.8+, and 3.8.4+.
Fixed sending emails crash on email addresses with display names longer
then 75 chars on Python 3.6.11+, 3.7.8+, and 3.8.4+.

Wrapped display names were passed to email.headerregistry.Address()
what caused raising an exception because address parts cannot contain
CR or LF.

See https://bugs.python.org/issue39073

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-07-20 07:10:40 +02:00
Mariusz Felisiak f405954ea2 Refs #31784 -- Added test for preventing header injection in display name of email addresses. 2020-07-20 07:10:16 +02:00
Mariusz Felisiak 3d16496037 Bumped asgiref requirement to >= 3.2.10.
Forwardported 3.1 release notes from 474f65406f.
2020-07-17 21:15:21 +02:00
Claudio Catterina faa6d41cda
Fixed typo in DecimalValidator tests.
This replaces redundant test for -Infinity with +Infinity.
2020-07-16 11:21:39 +02:00
Tim Park 8fa9a6d29e Fixed #31623 -- Allowed specifying number of adjacent time units in timesince()/timeuntil(). 2020-07-16 09:44:28 +02:00
Mariusz Felisiak 240cbb63bf
Fixed #31790 -- Fixed setting SameSite and Secure cookies flags in HttpResponse.delete_cookie().
Cookies with the "SameSite" flag set to None and without the "secure"
flag will be soon rejected by latest browser versions.

This affects sessions and messages cookies.
2020-07-16 08:16:58 +02:00
Simon Charette 156a2138db Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests. 2020-07-15 10:58:38 +02:00
Simon Charette 1e38f1191d Fixed #30446 -- Resolved Value.output_field for stdlib types.
This required implementing a limited form of dynamic dispatch to combine
expressions with numerical output. Refs #26355 should eventually provide
a better interface for that.
2020-07-15 10:58:29 +02:00
Simon Charette 1b7623fdfd Refs #30446 -- Defined output_field of BoundingCircle() GIS database function.
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. BoundingCircle(Polygon, num_seg=12)).
2020-07-14 09:36:17 +02:00
Simon Charette 9c5c9bd709 Stopped adapting DecimalField values to strings on PostgreSQL.
The psycopg2 backend uses the type information to provide type hints.
2020-07-14 07:40:10 +02:00
Simon Charette f783a99072 Refs #25425 -- Allowed unresolved Value() instances to be compiled.
Previously unresolved Value() instances were only allowed to be
compiled if they weren't initialized with an output_field.

Given the usage of unresolved Value() instances is relatively common in
as_sql() overrides it's less controversial to add explicit support for
this previously undefined behavior now and revisit whether or not it
should be deprecated in the future.
2020-07-14 07:20:20 +02:00