Commit Graph

12376 Commits

Author SHA1 Message Date
Jacob Walls 03cadb912c Removed a Python error message dependency in test_questioner_no_default_bad_user_entry_code(). 2021-12-20 11:11:39 +01:00
Jacob Walls 1833a9eee9 Increased test coverage of django.db.migrations.questioner. 2021-12-20 11:11:39 +01:00
Alexander Filimonov 448145092c Refs #27674 -- Added tests for GISModelAdmin.gis_widget_kwargs. 2021-12-20 08:12:12 +01:00
mendespedro e8b4feddc3 Fixed #33367 -- Fixed URLValidator crash in some edge cases. 2021-12-20 07:30:22 +01:00
mendespedro 4fd3044ca0 Fixed #33368 -- Fixed parse_duration() crash on invalid separators for decimal fractions. 2021-12-20 06:46:34 +01:00
Simon Charette 4328970780 Fixed #33366 -- Fixed case handling with swappable setting detection in migrations autodetector.
The migration framework uniquely identifies models by case insensitive
labels composed of their app label and model names and so does the app
registry in most of its methods (e.g. AppConfig.get_model) but it
wasn't the case for get_swappable_settings_name() until this change.

This likely slipped under the radar for so long and only regressed in
b9df2b74b9 because prior to the changes
related to the usage of model states instead of rendered models in the
auto-detector the exact value settings value was never going through a
case folding hoop.

Thanks Andrew Chen Wang for the report and Keryn Knight for the
investigation.
2021-12-17 07:46:58 +01:00
Mariusz Felisiak 40165eecc4
Fixed #33350 -- Reallowed using cache decorators with duck-typed HttpRequest.
Regression in 3fd82a6241.

Thanks Terence Honles for the report.
2021-12-16 20:13:17 +01:00
mgaligniana 068b2c072b Fixed #30127 -- Deprecated name argument of cached_property(). 2021-12-16 18:52:27 +01:00
Mariusz Felisiak 882647a82c
Used subTest() in forms.URLField() tests. 2021-12-16 06:35:44 +01:00
mgaligniana ac5cc6cf01 Fixed #33316 -- Added pagination to admin history view. 2021-12-15 10:54:08 +01:00
Jacob Walls 76ccce64cc Fixed #16063 -- Adjusted admin changelist searches spanning multi-valued relationships.
This reduces the likelihood of admin searches issuing queries with
excessive joins.
2021-12-15 08:14:19 +01:00
Florian Apolloner e1d673c373 Fixed unescape_string_literal() crash on empty strings. 2021-12-14 20:19:44 +01:00
Florian Apolloner 5d9c512e5b Added test for ValueErrors in unescape_string_literal(). 2021-12-14 20:18:43 +01:00
mdalp 3b73f77ad4 Fixed #33358 -- Fixed handling timedelta < 1 day in schema operations on Oracle. 2021-12-14 09:08:25 +01:00
Jeremy Lainé 2f33217ea2 Fixed #33361 -- Fixed Redis cache backend crash on booleans. 2021-12-14 07:16:30 +01:00
Jeremy Lainé c7902612ca Refs #33361 -- Added Added DummyCache.set() test for boolean values. 2021-12-14 06:47:37 +01:00
mgaligniana e61abab6e0 Refs #33338 -- Added never_cache() tests for Expires header. 2021-12-13 15:32:24 +01:00
Adam Johnson 5111b636d9 Refs #33355 -- Fixed Trunc() with years < 1000 on SQLite.
Thanks to Nick Pope for spotting the bug in Code Review.

Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-13 11:50:45 +01:00
Mariusz Felisiak c66ecc5568 Refs #33355 -- Moved Trunc() assertions for invalid arguments and ISO 8601 week to separate tests. 2021-12-13 11:28:35 +01:00
mendespedro 75485d16a2 Fixed #33351 -- Made path()/re_path() raise TypeError when kwargs argument is not a dict. 2021-12-13 08:09:28 +01:00
Mariusz Felisiak 2f73e5406d Refs #32502 -- Avoided table rebuild when adding fields with no default on SQLite. 2021-12-10 17:13:05 +01:00
Adam Johnson 0d2435328a Added test for field names of ManagementForm. 2021-12-10 10:01:33 +01:00
Mariusz Felisiak 974e3b8750
Fixed inspectdb.tests.InspectDBTestCase.test_custom_fields() on SQLite 3.37+.
Use FlexibleFieldLookupDict which is case-insensitive mapping because
SQLite 3.37+ returns some data type names upper-cased e.g. TEXT.
2021-12-09 20:24:38 +01:00
Arsa 17df72114e Fixed #33340 -- Fixed unquoted column names in queries used by DatabaseCache. 2021-12-09 11:16:04 +01:00
David Smith eba9a9b7f7 Refs #32338 -- Added Boundfield.legend_tag(). 2021-12-09 07:16:33 +01:00
Ömer Faruk Abacı 81739a45b5 Fixed #33319 -- Fixed crash when combining with the | operator querysets with aliases that conflict. 2021-12-08 21:16:24 +01:00
Baptiste Mispelon cb383753c0 Fixed #33346 -- Fixed SimpleTestCase.assertFormsetError() crash on a formset named "form".
Thanks OutOfFocus4 for the report.

Regression in 456466d932.
2021-12-08 20:33:03 +01:00
Shreya Bamne 8a4e506760 Fixed #19721 -- Allowed admin filters to customize the list separator. 2021-12-08 15:25:52 +01:00
Mariusz Felisiak 513441240f
Updated asgiref dependency for 4.0 release series. 2021-12-07 09:49:39 +01:00
Florian Apolloner d4dcd5b9dd Fixed #30530, CVE-2021-44420 -- Fixed potential bypass of an upstream access control based on URL paths.
Thanks Sjoerd Job Postmus and TengMA(@te3t123) for reports.
2021-12-07 06:28:08 +01:00
Mariusz Felisiak 628b6a6869 Updated translations from Transifex.
This also fixes related i18n tests.

Forwardport of 4c5215ab03 from stable/4.0.x

Co-authored-by: Claude Paroz <claude@2xlibre.net>
2021-12-06 20:31:03 +01:00
Hannes Ljungberg 1eaf38fa87 Fixed #33335 -- Made model validation ignore functional unique constraints.
Regression in 3aa545281e.

Thanks Hervé Le Roy for the report.
2021-12-06 07:59:11 +01:00
Mariusz Felisiak d3a64bea51
Refs #33333 -- Fixed PickleabilityTestCase.test_annotation_with_callable_default() crash on Oracle.
Grouping by LOBs is not allowed on Oracle. This moves a binary field to
a separate model.
2021-12-04 15:55:03 +01:00
Maxim Piskunov d3f4c2b95d Fixed #33078 -- Added support for language regions in i18n_patterns(). 2021-12-03 12:57:06 +01:00
Mariusz Felisiak 4f7bbc6138 Refs #33078 -- Added extra assertions to MiscTests.test_get_language_from_path_real(). 2021-12-03 12:03:30 +01:00
Mariusz Felisiak 2c7846d992
Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField on PostgreSQL.
This makes models.BinaryField pickleable on PostgreSQL.

Regression in 3cf80d3fcf.

Thanks Adam Zimmerman for the report.
2021-12-03 11:56:22 +01:00
Mariusz Felisiak 5def7f3f74 Updated various links to HTTPS and new locations.
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-02 11:27:29 +01:00
Simon Charette e5a92d400a Fixed #33282 -- Fixed a crash when OR'ing subquery and aggregation lookups.
As a QuerySet resolves to Query the outer column references grouping logic
should be defined on the latter and proxied from Subquery for the cases where
get_group_by_cols is called on unresolved expressions.

Thanks Antonio Terceiro for the report and initial patch.
2021-12-02 07:23:33 +01:00
Przemysław Suliga 4ce59f602e Fixed #30398 -- Added CONN_HEALTH_CHECKS database setting.
The CONN_HEALTH_CHECKS setting can be used to enable database
connection health checks for Django's persistent DB connections.

Thanks Florian Apolloner for reviews.
2021-12-01 07:44:48 +01:00
Claude Paroz 64c3f049ea Fixed #33047 -- Fixed CheckConstraint crash with GIS lookups on PostGIS and MySQL GIS backends.
Thanks Daniel Swain for the report and Arsalan Ghassemi for the initial
patch.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-30 20:06:29 +01:00
Chris Jerdonek 3ff7f6cf07 Refs #32800 -- Renamed _sanitize_token() to _check_token_format(). 2021-11-29 10:48:31 +01:00
Chris Jerdonek 5d80843ebc Fixed #32800 -- Changed CsrfViewMiddleware not to mask the CSRF secret.
This also adds CSRF_COOKIE_MASKED transitional setting helpful in
migrating multiple instance of the same project to Django 4.1+.

Thanks Florian Apolloner and Shai Berger for reviews.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-29 10:47:39 +01:00
Shubh1815 05e29da421 Fixed #32545 -- Improved admin widget for raw_id_fields for UUIDFields.
Co-Authored-By: Jerome Leclanche <jerome@leclan.ch>
2021-11-29 07:16:26 +01:00
Hannes Ljungberg ed2018037d Fixed #33322 -- Fixed loss of assigned related object when saving relation with bulk_update(). 2021-11-29 06:27:22 +01:00
Baptiste Mispelon 9ac92b1efc Refs #33301 -- Made SimpleTestCase.assertFormError()/assertFormsetErrors() raise ValueError for non test client responses. 2021-11-26 13:10:43 +01:00
Baptiste Mispelon 68144f4049 Added tests for SimpleTestCase.assertFormError()/assertFormsetErrors(). 2021-11-26 12:36:25 +01:00
Hasan Ramezani 24b316536a Fixed #33303 -- Changed messages' level tags on MESSAGE_TAGS setting change. 2021-11-26 07:09:31 +01:00
Ad Timmering 9a6e2df3a8 Fixed #32397 -- Made startapp/startproject management commands set User-Agent.
This sets User-Agent to 'Django/<version>'.
2021-11-25 20:36:04 +01:00
Shubh1815 51c24d8799 Fixed #33024 -- Fixed height of admin selector boxes in collapsed fieldset.
Thanks Tom Carrick for the review.
2021-11-25 07:57:19 +01:00
Ad Timmering 59f4796918 Fixed #4282 -- Made startapp/startproject management commands honor umask.
Co-authored-by: Christian Schmitt <c.schmitt@briefdomain.de>
2021-11-24 13:10:45 +01:00
mgaligniana 7f8f69fb38 Fixed #33298 -- Added docs and tests for using Q objects with get_object_or_404()/get_list_or_404(). 2021-11-24 09:28:21 +01:00
Tim Graham ddf321479b
Removed unneeded @skipUnlessDBFeature('supports_combined_alters').
The test acts a regression test for 715ccfde24
if the feature is True, but it works on other backends too.
2021-11-24 09:13:28 +01:00
Tim Graham 9772eaa6c0
Fixed typo in delete test docstring. 2021-11-24 09:04:54 +01:00
arsalan.ghassemi bdcda1ca9b Fixed #33309 -- Fixed QuerySet.distinct() crash on mixed case annotation. 2021-11-23 20:43:20 +01:00
Simon Charette aec71aaa5b Fixed #33304 -- Allowed passing string expressions to Window(order_by). 2021-11-23 07:58:44 +01:00
Baptiste Mispelon e6e664a711 Fixed #33302 -- Made element_id optional argument for json_script template filter.
Added versionchanged note in documentation
2021-11-22 11:52:19 +01:00
Baptiste Mispelon a0ed3cfad1 Fixed #33305 -- Fixed autodetector crash for ForeignKey with hardcoded "to" attribute.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2021-11-22 06:46:25 +01:00
SwastikTripathi a7e7043c87 Fixed #33229 -- Fixed BaseDatabaseOperations.adapt_datetimefield_value()/adapt_timefield_value() crash with expressions. 2021-11-19 09:47:57 +01:00
Jonny Park 6fa2930573 Refs #24121 -- Added __repr__() to BaseDatabaseWrapper, JoinPromoter, and SQLCompiler. 2021-11-19 07:57:02 +01:00
Shubh1815 bb223c6f78 Fixed #28357 -- Fixed ModelAdmin.prepopulated_fields on newly added stacked inline.
Thanks Jakob Köhler for the initial patch.
2021-11-16 12:24:56 +01:00
Chris Jerdonek 3f0025c18a Refs #32800 -- Avoided use of _does_token_match() in some CSRF tests. 2021-11-16 11:21:30 +01:00
Chris Jerdonek 0820175d81 Refs #32800 -- Added CSRF tests for masked and unmasked secrets during GET. 2021-11-16 11:02:32 +01:00
SwastikTripathi 76f07b4fcf Fixed #33278 -- Improved error for connection/query attempts against disallowed databases in tests. 2021-11-15 11:46:10 +01:00
Simon Charette 483e30c3d5 Fixed #33288 -- Made SQLite introspection use information schema for relations.
Previous solution was using brittle and complex parsing rules to
extract them from the SQL used to define the tables.

Removed a now unnecessary unit test that ensured the removed parsing
logic accounted for optional spacing.
2021-11-15 08:07:07 +01:00
Simon Charette 30ec7fe89a Refs #33288 -- Made SQLite introspection raise DatabaseError on nonexistent tables.
All the other backends behave this way and we had to make adjustments
to our test suite to account for this discrepancy.

This also allows SQLite's get_relations() not to raise on a nonexistent
table while making sure the InspectDBTestCase.test_introspection_errors
test which ensures an error during introspection is surfaced in
generated models files still passes.
2021-11-15 07:57:00 +01:00
Krzysztof Jagiello 8d9827c06c Fixed #33161 -- Enabled durability check for nested atomic blocks in TestCase.
Co-Authored-By: Adam Johnson <me@adamj.eu>
2021-11-12 13:05:56 +01:00
Can Sarigol 661316b066 Fixed #33279 -- Fixed handling time zones with "-" sign in names.
Thanks yakimka for the report.

Regression in fde9b7d35e.
2021-11-12 07:30:02 +01:00
Lie Ryan 05cde4764d Fixed #33269 -- Made AnonymousUser/PermissionsMixin.has_perms() raise ValueError on string or non-iterable perm_list. 2021-11-11 20:26:29 +01:00
Ad Timmering 4bfe8c0eec Fixed #6106 -- Prevented makemessages from changing .po files when up to date.
Co-authored-by: Daniyal Abbasi <abbasi.daniyal98@gmail.com>
2021-11-11 09:12:05 +01:00
Mariusz Felisiak 0b95a96ee1
Removed DatabaseIntrospection.get_key_columns().
Thanks Simon Charette for the report.
2021-11-10 16:38:43 +01:00
Mariusz Felisiak 6bc437c0d8
Refs #33263 -- Added warning to BaseDeleteView when delete() method is overridden.
Follow up to 3a45fea083.
2021-11-09 09:03:40 +01:00
Jacob Walls 948d6d8805 Refs #16063 -- Added tests for searching against multiple related fields in admin changelist. 2021-11-09 07:00:36 +01:00
Baptiste Mispelon 91acfc3514 Fixed #33264 -- Made test runner return non-zero error code for unexpected successes. 2021-11-08 20:19:21 +01:00
Matthijs Kooijman 1a5023883b Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on SQLite. 2021-11-08 18:02:56 +01:00
Keryn Knight 4f8c7fd9d9 Fixed #32980 -- Made models cache related managers. 2021-11-08 08:44:12 +01:00
Mariusz Felisiak ba9ced3e9a
Fixed #33253 -- Reverted "Fixed #32319 -- Added ES module support to ManifestStaticFilesStorage."
This reverts commit 91e21836f6.

`export` and `import` directives have several syntax variants and not
all of them were properly covered.

Thanks Hervé Le Roy for the report.
2021-11-05 12:11:18 +01:00
David Smith c6c6cd3c5a Fixed #33235 -- Removed "for = ..." from MultiWidget's <label>.
This improves accessibility for screen reader users.
2021-11-05 11:05:52 +01:00
Carlton Gibson 4816dc9428 Fixed #33237 -- Fixed detecting source maps in ManifestStaticFilesStorage for multiline files.
Switched regex to multiline mode in order to match per-line, rather
than against the whole file.

Thanks to Joseph Abrahams for the report.

Regression in 781b44240a.
2021-11-04 20:28:35 +01:00
Guilherme Martins Crocetti fc565cb539 Fixed #27147 -- Allowed specifying bounds of tuple inputs for non-discrete range fields. 2021-11-04 19:08:57 +01:00
Guilherme Martins Crocetti 52f6927d7f Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations. 2021-11-04 19:08:57 +01:00
Hannes Ljungberg a934d377af Fixed #33262 -- Fixed crash of conditional aggregation on Exists(). 2021-11-04 06:31:32 +01:00
Hannes Ljungberg 25157033e9 Fixed #33260 -- Fixed crash when chaining QuerySet.exists() after select_for_update(of=()). 2021-11-03 20:08:14 +01:00
Keryn Knight a697424969 Fixed #32996 -- Cached PathInfos on relations.
PathInfo values are ostensibly static over the lifetime of the object
for which they're requested, so the data can be memoized, quickly
amortising the cost over the process' duration.
2021-11-03 11:27:04 +01:00
Iuri de Silvio 3ff7b15bb7 Fixed #33252 -- Made cache middlewares thread-safe. 2021-11-03 09:39:27 +01:00
Iuri de Silvio 0c05c183e4 Refs #33252 -- Used @override_settings in BaseCacheTests.test_cache_write_unpicklable_object() 2021-11-03 09:05:12 +01:00
Roman 407fe95cb1 Fixed #32691 -- Made Exact lookup on BooleanFields compare directly to a boolean value on MySQL.
Performance regression in 37e6c5b79b.

Thanks Todor Velichkov for the report.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-02 21:30:21 +01:00
jordan.bae aaf9b55858 Fixed #33187 -- Made inspectdb handle ForeignKey.to_field attribute. 2021-11-02 18:53:11 +01:00
Mariusz Felisiak dab48b7482
Fixed #33234 -- Fixed autodetector crash for proxy models inheriting from non-model class.
Regression in aa4acc164d.

Thanks Kevin Marsh for the report.
2021-11-02 15:34:08 +01:00
Hasan Ramezani c069ee0b9d Fixed #33224 -- Removed DatabaseFeatures.supports_mixed_date_datetime_comparisons. 2021-11-02 07:30:38 +01:00
andrewdotn 9e6d631697
Fixed #33246 -- Made squashmigrations raise CommandError when squashed_name already exists. 2021-11-02 07:13:42 +01:00
Mariusz Felisiak c3e0dfe4cc
Fixed isolation of admin_views.tests.ValidXHTMLTests. 2021-11-02 07:03:11 +01:00
Pratyush Mittal f38458fe56 Fixed #33236 -- Fixed assertHTMLEqual() error messages for escaped HTML. 2021-10-29 12:09:23 +02:00
Iuri de Silvio afeafd6036 Fixed #33201 -- Made RenameModel operation a noop for models with db_table. 2021-10-27 12:41:29 +02:00
Anv3sh 69af4d09ba Fixed #32672 -- Fixed introspection of primary key constraints on SQLite.
Thanks Simon Charette for the implementation idea.
2021-10-26 09:50:23 +02:00
Mariusz Felisiak d446f8ba08
Corrected AutodetectorTests.test_rename_field_and_foo_together()'s docstring. 2021-10-26 08:46:50 +02:00
Jacob Walls def09bf412 Fixed #27079 -- Avoided multiple setUpClass()/tearDownClass() calls in LiveServerTestCase tests. 2021-10-26 07:47:40 +02:00
Tim Graham cbd9f8531d
Removed duplicated lines in test_in_lookup_allows_F_expressions_and_expressions_for_datetimes(). 2021-10-26 07:22:20 +02:00
David Wobrock 0314593fe8 Fixed #31503 -- Made autodetector remove unique/index_together before altering fields. 2021-10-25 10:10:02 +02:00
Hasan Ramezani c1e4111c74 Fixed #33205 -- Made call_command() raise TypeError when dest with multiple arguments is passed. 2021-10-25 07:48:06 +02:00
Jacob Walls 1feb55d607
Fixed typo in tests/servers/tests.py. 2021-10-25 07:42:06 +02:00
Manaia Junior 551c997fea Fixed #33214 -- Added BaseDatabaseOperations.format_for_duration_arithmetic() stub method. 2021-10-22 08:19:02 +02:00
Mariusz Felisiak 9231526af4
Fixed #33215 -- Confirmed support for GEOS 3.10. 2021-10-21 20:23:58 +02:00
David Smith 480191244d Fixed #25916 -- Added lastmod support to sitemap index view.
Co-authored-by: Matthew Downey <matthew.downey@webit.com.au>
2021-10-21 15:26:22 +02:00
David Smith 2ce03a2bac Refs #25916 -- Isolated sitemap.test_utils tests 2021-10-21 15:26:22 +02:00
Carlton Gibson 2ccc0b22db Fixed #33211 -- Updated tests for Selenium 4.0.0.
Replaced deprecated `find_element[s]_by_*()` usages, in favour of
`find_element[s]()` with an explicit `By`.
2021-10-21 14:37:16 +02:00
Carlton Gibson 8fa974fcdd Refs #33211 -- Added assertCountSeleniumElements() test helper. 2021-10-21 14:37:16 +02:00
Adam Johnson 45f48ed4f7 Made F deconstruction omit 'expressions' in the path. 2021-10-21 09:40:52 +02:00
Vinay Karanam 8806e8809e Fixed #33043 -- Made method_decorator() preserve wrapper assignments.
Regression in f434f5b84f.
2021-10-20 16:48:00 +02:00
Shreya Bamne 004b4620f6 Fixed #32987 -- Added system check for template tag modules with the same name.
Co-authored-by: Daniel Fairhead <daniel@dev.ngo>
2021-10-20 11:15:47 +02:00
David Smith 7ef0bc922c Refs #32956 -- Capitalized HTTP/HTTPS in comments, docs, and docstrings. 2021-10-20 08:40:19 +02:00
Simon Charette 5896aa8367 Fixed #33197 -- Made field rename with prior matching db_column change a noop.
Thanks Jacob Walls for the report.
2021-10-19 06:46:35 +02:00
David Smith 69b0736fad Refs #32956 -- Changed docs to treat the acronym HTTP phonetically. 2021-10-18 21:00:28 +02:00
Hannes Ljungberg 86971c4090 Fixed #33194 -- Fixed migrations when altering a field with functional indexes/unique constraints on SQLite.
This adjusts Expressions.rename_table_references() to only update alias
when needed.

Regression in 83fcfc9ec8.

Co-authored-by: Simon Charette <charettes@users.noreply.github.com>
2021-10-18 08:25:23 +02:00
Mariusz Felisiak 569a33579c
Refs #32074 -- Removed usage of deprecated asyncore and smtpd modules.
asyncore and smtpd modules were deprecated in Python 3.10.
2021-10-15 09:58:35 +02:00
Jacob Walls 15683cdb95 Fixed #23953 -- Made makemigrations continue number sequence for squashed migrations. 2021-10-15 06:59:31 +02:00
Jacob Walls 6e4ac28af0 Refs #23953 -- Added MigrationAutodetector.parse_number() tests. 2021-10-15 06:59:31 +02:00
Piotr Kunicki cb8d7ca0ba Refs #30509 -- Adjusted FileResponse test to close file earlier. 2021-10-14 15:05:27 +02:00
Piotr Kunicki dc724c5bf9 Fixed #30509 -- Made FileResponse better handle buffers and non-zero file offsets. 2021-10-14 15:05:04 +02:00
Piotr Kunicki 3ac4764397 Refs #30509 -- Increased FileResponse test coverage.
Split tests by behavior, e.g. header, and added additional tests.
2021-10-14 15:04:30 +02:00
Martin Svoboda cc4cb95bef Fixed #33008 -- Fixed prefetch_related() for deleted GenericForeignKeys.
Thanks Simon Charette for the implementation idea.
2021-10-14 12:37:03 +02:00
Mariusz Felisiak cdad96e633
Refs #27131 -- Removed SMTPBackendTests.test_server_login().
test_server_login() was a regression test for a crash when passing
Unicode strings to SMTP server using CRAM-MD5 method on Python 2.
Python 2 is no longer supported and test_server_login() passes even
without FakeSMTPChannel.smtp_AUTH() because
smtplib.SMTPAuthenticationError is raised when AUTH is not implemented.
2021-10-14 11:36:51 +02:00
David Smith f345c9fb3e Refs #25916 -- Added tests for a callable lastmod on Sitemaps. 2021-10-14 08:13:22 +02:00
Jacob Walls 32f1fe5f89 Fixed #29470 -- Logged makemigrations automatic decisions in non-interactive mode. 2021-10-12 15:19:39 +02:00
Jacob Walls 241ba23870 Refs #29470 -- Added makemigrations test for adding fields with no default and auto_now_add=True in non-interactive mode. 2021-10-12 15:19:39 +02:00
Christophe Henry b1b26b37af Fixed #33178 -- Made createsuperuser validate required fields passed in options in interactive mode. 2021-10-12 08:08:05 +02:00
Christophe Henry 57273e1569 Refs #33178 -- Added createsuperuser tests for validation of foreign keys. 2021-10-12 07:54:50 +02:00
Christophe Henry 4ff500f294 Refs #21755 -- Fixed createsuperuser crash for required foreign keys passed in options in interactive mode.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-10-12 06:59:46 +02:00
Mariusz Felisiak da266b3c5c
Refs #29628, Refs #33178 -- Made createsuperuser validate password against required fields passed in options. 2021-10-12 06:21:14 +02:00
Mariusz Felisiak 01bf679e59
Fixed #33022 -- Fixed isolation of migrations.test_executor.ExecutorTests.test_custom_user(). 2021-10-08 15:51:04 +02:00
Jacob Walls 28f66b2783 Refs #25467 -- Added test for excluding one-to-one relation with unsaved objects.
Fixed in 58da81a5a3.
2021-10-08 06:26:19 +02:00
Jacob Walls e17ab0af91 Fixed tests.queries.models.StaffUser.__str__(). 2021-10-08 06:25:17 +02:00
Christophe Henry df2d2bc95c Fixed #33151 -- Fixed createsuperuser crash for many-to-many required fields in non-interactive mode. 2021-10-07 12:37:16 +02:00
Bernd Wechner 2116238d5f Fixed #33131 -- Improved error messages for clashing reverse accessor names. 2021-10-06 12:33:15 +02:00
Carlton Gibson 402ae37873 Refs #33029 -- Fixed popups Selenium tests in headless mode.
Co-authored-by: Yash Jhunjhunwala <yash@jhunjhunwalaadvisors.com>
2021-10-06 12:00:19 +02:00
Maxim Milovanov 1c802ca2a9
Fixed #33156 -- Used sessionStorage to preserve quick filter for admin's navigation sidebar. 2021-10-06 09:01:31 +02:00
Jacob Walls 47f791f132 Fixed #23408 -- Added migrations questioner prompt for adding unique fields with a callable default. 2021-10-06 08:05:33 +02:00
Sarah Abderemane 533f345c09 Refs #27694 -- Added more tests for chaining lookups with HStoreField key transforms. 2021-10-04 07:18:16 +02:00
Nick Pope c2f6c05c4c Refs #32943 -- Added support for covering exclusion constraints using SP-GiST indexes on PostgreSQL 14+. 2021-10-01 13:11:37 +02:00
Nick Pope e76f9d5b44 Refs #32943 -- Added support for covering SP-GiST indexes on PostgreSQL 14+. 2021-10-01 13:11:34 +02:00
Nick Pope bd47b9bc81 Fixed #32961 -- Added BitXor() aggregate to django.contrib.postgres. 2021-10-01 10:32:39 +02:00
Nick Pope 000d430234 Fixed typo in exception message for GiST indexes and exclusion constraints. 2021-10-01 09:46:36 +02:00
Nick Pope dd26362f63 Fixed SpGistIndex tests on PostgreSQL 14+. 2021-10-01 09:17:59 +02:00
Daniel Hahler 98c8bf1cee
Fixed #33160 -- Avoided suppressing query errors in _nodb_cursor() on PostgreSQL. 2021-10-01 07:23:57 +02:00
Yash Jhunjhunwala 492ed60f23 Fixed #33029 -- Allowed multiple popups for self-related fields in admin. 2021-09-30 15:42:30 +02:00
Aljaž Košir 7b8beeee3d
Fixed #33155 -- Made ModelChoiceIteratorValue instances hashable. 2021-09-30 12:07:50 +02:00
Mariusz Felisiak 903aaa35e5
Fixed #33159 -- Reverted "Fixed #32970 -- Changed WhereNode.clone() to create a shallow copy of children."
This reverts commit e441847eca.

A shallow copy is not enough because querysets can be reused and
evaluated in nested nodes, which shouldn't mutate JOIN aliases.

Thanks Michal Čihař for the report.
2021-09-30 11:26:17 +02:00
David Wobrock dd1fa3a31b Fixed #33018 -- Fixed annotations with empty queryset.
Thanks Simon Charette for the review and implementation idea.
2021-09-29 20:23:29 +02:00
David Wobrock ad36a198a1 Fixed #33141 -- Renamed Expression.empty_aggregate_value to empty_result_set_value. 2021-09-29 12:58:01 +02:00
Chenyang Yan 36d54b7a14 Fixed #33027 -- Made autoreloader pass -X options. 2021-09-29 11:37:50 +02:00
David Smith 4884a87e02 Fixed #33134 -- Fixed recursion depth error when rendering Form with BoundFields.
Regression in 456466d932.
2021-09-29 08:04:42 +02:00
Chinmoy Chakraborty b7fd668b37 Fixed #33033 -- Prevented models.DecimalField from accepting NaN values. 2021-09-28 13:20:14 +02:00
Jordan Bae f5a3243911 Fixed #33125 -- Avoided redundant unique constraint when converting a non-unique field to primary key on MySQL and PostgreSQL. 2021-09-28 06:20:37 +02:00
Claude Paroz 4ffada3609 Fixed #33136 -- Added GEOSGeometry.make_valid() method. 2021-09-27 09:58:28 +02:00
Adam Johnson 840ad06300 Refs #32355 -- Modernized subprocess.run() calls. 2021-09-27 08:20:24 +02:00
ali ca58378390 Fixed #33114 -- Defined default output_field of StringAgg.
Thanks Simon Charette for the review.
2021-09-27 06:58:54 +02:00
Jaap Roes 7fe9b6f6df Fixed #33130 -- Restored form errors to be a dict.
Regression in 456466d932.
2021-09-24 10:50:41 +02:00
Jaap Roes b1bf8c8a4b Fixed #33132 -- Fixed test client handling of querystring only redirects.
Regression in 1e5aa8e1c7.
2021-09-24 08:22:28 +02:00
Hasan Ramezani f997c81472 Fixed #33127 -- Added error messages on | and & operators with combined querysets. 2021-09-24 06:59:22 +02:00
Nick Pope 448d974d96 Fixed #32499 -- Escaped additional metacharacters in simplify_regex(). 2021-09-22 11:59:59 +02:00
Nick Pope 85540da930 Refs #32499 -- Fixed escaped metacharacters in simplify_regex(). 2021-09-22 11:59:59 +02:00
Nick Pope 9f7809ece3 Refs #32499 -- Added more tests for simplify_regex(). 2021-09-22 11:59:59 +02:00
Carlton Gibson e0a56ad3c8
Removed blocking wait in admin inlines selenium test.
find_elements_by_css_selector() implicitly waits the default timeout
(10 seconds) looking for missing elements.
2021-09-22 08:17:48 +02:00
Carlton Gibson b0ed619303
Fixed #33083 -- Fixed selecting all items in the admin changelist when actions are both top and bottom.
Thanks Benjamin Locher for the report.

Regression in 30e59705fc.
2021-09-21 19:58:00 +02:00
Hasan Ramezani 2f0f30f973 Fixed #33111 -- Fixed passing object to ModelAdmin.get_inlines() when editing in admin change view.
ModelAdmin.get_inlines() should get an unmutated object when creating
formsets during POST request.
2021-09-21 13:12:09 +02:00
Mariusz Felisiak 881a479911
Refs #31026 -- Fixed forms_tests if Jinja2 is not installed. 2021-09-21 10:16:44 +02:00
Cleiton Lima 8eb5693091 Fixed #33070 -- Fixed loading translations with language subtags in admin's Select2 widget. 2021-09-21 07:18:37 +02:00
Mariusz Felisiak 32b7ffc2bb Increased the default PBKDF2 iterations for Django 4.1. 2021-09-20 21:23:01 +02:00
Mariusz Felisiak 8b6d0333cf Advanced deprecation warnings for Django 4.1. 2021-09-20 21:23:01 +02:00
Mariusz Felisiak 737fa72ae3 Refs #32191 -- Removed for the pre-Django 3.2 format of messages in CookieStorage.
Per deprecation timeline.
2021-09-20 21:23:01 +02:00
Mariusz Felisiak 05f3a6186e Refs #32193 -- Removed MemcachedCache per deprecation timeline. 2021-09-20 21:23:01 +02:00
Mariusz Felisiak e2be307b3a Refs #31235 -- Made assertQuerysetEqual() not call repr() on a queryset when compared to string values.
Per deprecation timeline.
2021-09-20 21:23:01 +02:00
Mariusz Felisiak 75d6c4ae6d Refs #31180 -- Removed default_app_config application configuration variable per deprecation timeline. 2021-09-20 21:23:01 +02:00
Mariusz Felisiak d25710a625 Refs #31670 -- Removed whitelist argument and domain_whitelist attribute in EmailValidator per deprecation timeline. 2021-09-20 21:23:01 +02:00
Mariusz Felisiak 1cb495074f Refs #31546 -- Removed support for boolean values in Command.requires_system_checks.
Per deprecation timeline.
2021-09-20 21:23:01 +02:00
Mariusz Felisiak 2e10abeb7f Refs #31395 -- Removed support for assigning objects which don't support deepcopy() in setUpTestData().
Per deprecation timeline.
2021-09-20 21:23:01 +02:00
David Smith 456466d932 Fixed #31026 -- Switched form rendering to template engine.
Thanks Carlton Gibson, Keryn Knight, Mariusz Felisiak, and Nick Pope
for reviews.

Co-authored-by: Johannes Hoppe <info@johanneshoppe.com>
2021-09-20 15:50:18 +02:00
AliGhotbizadeh b8f3a3ad54 Refs #33119 -- Added tests for changing model name case referenced by ManyToManyField.
Fixed in aa4acc164d.
2021-09-20 12:00:10 +02:00
Ken Whitesell 0a9aa02e6f Fixed #33077 -- Fixed links to related models for admin's readonly fields in custom admin site. 2021-09-18 12:27:28 +02:00
Nikita Marchant 4e4082f939 Fixed #32492 -- Added TrigramWordSimilarity() and TrigramWordDistance() on PostgreSQL. 2021-09-17 13:05:15 +02:00
David Smith 4ca508a689 Refs #31026 -- Added extra form render tests. 2021-09-17 09:21:10 +02:00
David Smith 91e8b95d5b Refs #31026 -- Moved Template tests to separate class. 2021-09-17 09:20:02 +02:00
Giannis Adamopoulos 4555aa0a48 Fixed #27674 -- Deprecated GeoModelAdmin and OSMGeoAdmin.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-09-17 08:56:16 +02:00
Mariusz Felisiak f1bcaa9be8
Refs #32074 -- Fixed find_module()/find_loader() warnings on Python 3.10+. 2021-09-16 20:20:54 +02:00
Carlton Gibson 306607d5b9 Fixed #32365 -- Made zoneinfo the default timezone implementation.
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick
Pope, and Paul Ganssle for reviews.
2021-09-16 12:11:05 +02:00
Daniyal ec212c6616 Fixed #33012 -- Added Redis cache backend.
Thanks Carlton Gibson, Chris Jerdonek, David Smith, Keryn Knight,
Mariusz Felisiak, and Nick Pope for reviews and mentoring this
Google Summer of Code 2021 project.
2021-09-14 15:50:08 +02:00
Claude Paroz 676bd084f2 Fixed #32873 -- Deprecated settings.USE_L10N.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-09-14 12:05:43 +02:00
antoinehumbert de95c82667 Fixed #31867 -- Made TabularInline handling of hidden fields with view-only permissions consistent with StackedInline. 2021-09-10 10:10:53 +02:00
Jan Schär 06e59d97a3 Fixed #33096 -- Fixed <form> nesting in technical 500 template.
This also prevents sending <form> tags in emails.
2021-09-10 06:44:39 +02:00
Hasan Ramezani 0a28b42b15 Fixed #33084 -- Removed incorrect system check for ManyToManyField with limit_choices_to. 2021-09-09 12:07:59 +02:00
Siburg 46c8df640c Fixed #32219 -- Made InlineModelAdmin.verbose_name_plural fallback to its verbose_name. 2021-09-08 13:20:13 +02:00
Siburg 1bd6a7a0ac Refs #32219 -- Added admin model inline tests for verbose names.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-09-08 11:32:06 +02:00
Mariusz Felisiak 4a43335d30
Fixed #30086, Refs #32873 -- Made floatformat template filter independent of USE_L10N. 2021-09-08 08:37:27 +02:00
Andrew-Chen-Wang 301a85a12f Fixed #32076 -- Added async methods to BaseCache.
This also makes DummyCache async-compatible.
2021-09-07 20:14:25 +02:00
Nick Pope 4b82578a60 Refs #33060 -- Ensured cache backends validate keys.
The validate_key() function should be called after make_key() to ensure
that the validation is performed on the key that will actually be
stored in the cache.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-09-07 11:59:40 +02:00
Mariusz Felisiak ec2f6ea9c6 Refs #33060 -- Added memcached test for make_key() making keys invalid. 2021-09-07 11:57:14 +02:00
Mateo Radman a7f27fca52 Refs #32508 -- Raised TypeError/ValueError instead of using "assert" in encode() methods of remaining password hashers. 2021-09-06 07:47:53 +02:00
taulant 0e8be73812 Fixed #32975 -- Fixed admin system check for inlines with foreign keys to proxy models. 2021-09-03 06:48:32 +02:00
Nick Pope b8824e8d17 Refs #31907 -- Fixed incorrect argument for delete_many() in cache tests. 2021-09-02 12:47:04 +02:00
Daniyal Abbasi dca4c2ff76 Refs #33012 -- Moved PickleSerializer to django.core.serializers.base and added tests. 2021-09-02 11:24:55 +02:00
Mariusz Felisiak 50ed545e2f
Fixed #33082 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.9.7+.
Thanks Michał Górny for the report.
2021-09-02 10:56:56 +02:00
Stefanos I. Tsaklidis d0ea01af28 Fixed #33079 -- Fixed get_image_dimensions() on nonexistent images.
Thanks Nick Pope for the review.
2021-09-02 07:08:50 +02:00
David Wobrock 691486a5cf Fixed #33073 -- Fixed queryset crash with aggregation and empty/extra queryset annotation. 2021-09-01 20:59:16 +02:00
Mariusz Felisiak 338fc0e7f1 Fixed #33080 -- Preserved nullability of textual fields on Oracle.
Thanks Matt Hoskins for the report.
2021-09-01 20:54:12 +02:00
Mariusz Felisiak f65eb46646 Fixed typo in tests/schema/tests.py docstrings. 2021-09-01 20:54:12 +02:00
Alex Hayward eeed488a34 Fixed #32768 -- Added Vary header when redirecting to prefixed i18n pattern.
get_language_from_request() uses Accept-Language and/or Cookie to determine the
correct redirect. Upstream caches need the matching Vary header to cache the
result.
2021-09-01 14:02:37 +02:00
sage 84c7c4a477 Fixed #32309 -- Added --exclude option to startapp/startproject management commands. 2021-09-01 12:08:02 +02:00
sage 3686077d46 Refs #32309 -- Added test for excluding hidden directories in startproject command. 2021-09-01 11:05:10 +02:00
Mariusz Felisiak 1eb3f500a4
Fixed #33057 -- Fixed recreation of foreign key constraints in m2m tables when altering type of referenced primary key on Oracle. 2021-08-31 13:43:10 +02:00
Jan Szoja b667ac24ea Fixed #25264 -- Allowed suppressing base command options in --help output.
This also suppresses -verbosity and --trackback options in the
runserver's help.
2021-08-31 11:04:02 +02:00
Jan Szoja 97f377cd35 Refs #25264 -- Added test for command --help output with default options and custom arguments. 2021-08-31 11:03:58 +02:00
Sondre Lillebø Gundersen 2c912c3488 Fixed #33061 -- Fixed handling nonexistent keys with negative deltas in incr()/decr() in memcached backends.
Thanks Chris Jerdonek for the review.
2021-08-31 07:34:53 +02:00
Sondre Lillebø Gundersen 96ab3a1379 Refs #33061 -- Added DummyCache.incr()/decr() tests for nonexistent keys with negative deltas. 2021-08-31 07:30:57 +02:00
Jacob Walls 3219dd3388 Fixed #24900 -- Allowed migrating backward to squashed migrations. 2021-08-30 12:08:04 +02:00
Jacob Walls 9e17cc062c Refs #24900 -- Added MigrationLoader test for applying squashed migrations. 2021-08-30 11:40:27 +02:00
Carlton Gibson cbba49971b Fixed #32992 -- Restored offset extraction for fixed offset timezones.
Regression in 10d1261984.
2021-08-30 10:12:46 +02:00
Eugene Morozov d89f976bdd Fixed #33054 -- Made TestCase.captureOnCommitCallbacks() capture callbacks recursively. 2021-08-30 07:06:22 +02:00
Mateo Radman 02bc7161ec Fixed #32900 -- Improved migrations questioner prompts. 2021-08-27 13:27:41 +02:00
Mateo Radman 61c5eae516 Refs #32900 -- Added makemigrations tests for messages in interactive mode. 2021-08-27 13:27:41 +02:00
Mateo Radman d00fb4d2d6 Refs #32900 -- Added test for ignoring the default value in InteractiveMigrationQuestioner.ask_not_null_alteration(). 2021-08-27 13:27:37 +02:00
Hasan Ramezani d1216e126f Fixed #33051 -- Fixed highlighting the current model in admin's sidebar with non-ASCII model names. 2021-08-27 07:31:05 +02:00
David Smith 5942ab5eb1 Refs #32338 -- Made RadioSelect/CheckboxSelectMultiple render in <div> tags.
This improves accessibility for screen reader users.
2021-08-27 06:14:01 +02:00
Mariusz Felisiak fa1d7ba5b9
Refs #29898 -- Changed fields in ProjectState's relation registry to dict. 2021-08-26 07:49:37 +02:00
Manav Agarwal 196a99da5d Refs #29898 -- Made ProjectState encapsulate alterations in relations registry.
Thanks Simon Charette and Chris Jerdonek for reviews.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-08-25 09:12:01 +02:00
Chris Jerdonek b263f4b69d Fixed #32552 -- Added logger argument to DiscoverRunner. 2021-08-24 09:23:01 +02:00
Tim Graham 022d29c934
Refs #10929 -- Allowed NowUTC SQL customization for third-party backends. 2021-08-24 08:28:03 +02:00
Märt Häkkinen ed317e79e3 Fixed #33030 -- Fixed broken links to GDAL docs. 2021-08-23 06:22:07 +02:00
Matjaz Gregoric 518ce7a51f Fixed #33017 -- Fixed storage engine introspection on MySQL.
This also improves performance on MySQL instances with a large number
of databases, since querying the information_schema table can be very
slow
2021-08-20 11:05:21 +02:00
Chris Jerdonek faf6d48590 Removed reference to nonexistent collectstatic --exclude-dirs option. 2021-08-19 12:49:46 +02:00
Chris Jerdonek 7800596924 Fixed #33014 -- Made ProjectState raise exception when real_apps argument is not a set. 2021-08-19 10:18:51 +02:00
Jonny Park 4e8121e8e4 Fixed #32994 -- Fixed autoreloader tests when using 'python -m'. 2021-08-19 09:20:31 +02:00
Mariusz Felisiak 36714be874 Refs #31621 -- Fixed handling --parallel option in test management command and runtests.py.
Regression in ae89daf46f.
Thanks Tim Graham for the report.
2021-08-19 09:18:32 +02:00
Mariusz Felisiak c2a5735d86 Refs #31621 -- Added more tests for test --parallel option. 2021-08-19 09:18:32 +02:00
Matt Westcott 5092f7247d Fixed #33036 -- Made simple_tag()/inclusion_tag() with takes_context raise TemplateSyntaxError when function has no parameters. 2021-08-19 07:39:55 +02:00
Chris Jerdonek be1fd6645d Refs #32800 -- Added test_masked_secret_accepted_and_not_replaced().
This improves test_bare_secret_accepted_and_replaced() by adding a stronger
assertion. It also adds a parallel test for the non-bare (masked) case.
2021-08-17 12:23:54 +02:00
Chris Jerdonek 7aba820aca Refs #32800 -- Improved CsrfViewMiddlewareTestMixin._check_token_present().
This changes CsrfViewMiddlewareTestMixin._check_token_present() to give more
detailed information if the check fails, and in particular why it failed. It
also moves CsrfFunctionTests.assertMaskedSecretCorrect() to a separate
CsrfFunctionTestMixin so the helper can be used in CsrfViewMiddlewareTestMixin.
2021-08-17 12:23:54 +02:00
Chris Jerdonek 26d8e3f302 Refs #32800 -- Used the cookie argument to CsrfViewMiddlewareTestMixin._get_request() in more tests. 2021-08-17 12:23:54 +02:00
Mariusz Felisiak 54a30a7a00 Refs #29898 -- Changed ProjectState.real_apps to set. 2021-08-11 09:01:14 +02:00
David Smith 3a6431db54 Refs #29205 -- Added MultiValueField test for rendering of optional subfields. 2021-08-10 12:49:06 +02:00
Mart Sõmermaa 9b1158a7e0 Fixed #32993 -- Added AutocompleteJsonView.serialize_result() to allow customization. 2021-08-10 07:44:37 +02:00
Mariusz Felisiak 65ed96fa39 Refs #33002 -- Added DebugLexer/Lexer.tokenize() test for trailing text token. 2021-08-09 13:42:26 +02:00
Chris Jerdonek b2be7e12cc Refs #33002 -- Made template_tests.tests.py's tests test both Lexer and DebugLexer. 2021-08-09 13:37:02 +02:00
Greg Twohig c99aaf14ee Refs #32990 -- Added tests for DebugLexer/Lexer.tokenize(). 2021-08-09 08:21:37 +02:00
David Smith 8208381ba6 Refs #32956 -- Corrected spelling of daylight saving time.
AP Stylebook: Saving not savings, no hyphen, and lowercase.
2021-08-06 13:00:24 +02:00
Mariusz Felisiak 61d92c650f Refs #22123 -- Added more URLValidator test for invalid IPv6 literals. 2021-08-06 12:58:55 +02:00
Nick Touran 5d4f21b16f Fixed #32983 -- Added system check for redundant related_name on symmetrical M2M fields.
Since ManyToManyFields defined with `symmetrical=True` do not add a
related field to the target model, including a `related_name` argument
will never do what the coder likely expects. This makes including
a related_name with a symmetrical model raise a system check warning.

ticket-32983
2021-08-06 11:57:02 +02:00
Nick Touran 1fb21ab377 Refs #32983 -- Removed unneeded related_name from test model definitions. 2021-08-06 11:57:02 +02:00
Jarosław Wygoda d3c4696596 Fixed #27590 -- Allowed customizing a manifest file storage in ManifestFilesMixin. 2021-08-05 12:40:34 +02:00
Mariusz Felisiak ab16507f19
Fixed #32988 -- Prevented creation of more test databases than TestCases.
DiscoverRunner.parallel is used in setup_databases() and
teardown_databases() to control the number of test databases.

Regression in cb6c19749d.
2021-08-05 05:55:35 +02:00
Jacob Walls 2d0ae8da80 Fixed #29205 -- Corrected rendering of required attributes for MultiValueField subfields. 2021-08-04 17:37:04 +02:00
Jacob Rief db1fc5cd3c Fixed #32855 -- Corrected BoundWidget.id_for_label() with custom auto_id. 2021-08-04 15:18:00 +02:00
Jacob Walls 910ecd1b8d Fixed #29063 -- Fixed migrate crash when specifying a name of partially applied squashed migrations. 2021-08-04 09:57:32 +02:00
Jacob Walls 202d3e193a Fixed typos in migrations tests, comments, and error message. 2021-08-04 09:28:23 +02:00
Mariusz Felisiak 52f9cfee9f Used assertRaisesMessage() to test MigrationLoader.get_migration_by_prefix()'s error messages. 2021-08-04 09:20:26 +02:00
Michał Górny 7afca03c40 Refs #32074 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.10+.
Python 3.10.0rc1 changed the error messages issued by argparse on
invalid choice to include the argument name. Update the expected test
output to account for that.
2021-08-04 07:59:08 +02:00
Ties Jan Hefting 4f3acf9579 Fixed #32984 -- Allowed customizing a deletion field widget in formsets. 2021-08-03 13:12:50 +02:00
Ties Jan Hefting 47cb85b542 Fixed typos in tests/forms_tests/tests/test_formsets.py. 2021-08-03 12:53:45 +02:00
Adam Johnson ae89daf46f Fixed #31621 -- Added support for '--parallel auto' to test management command. 2021-08-03 09:57:04 +02:00
Adam Johnson 7e38a8d66f Refs #31621 -- Added more tests for test --parallel option. 2021-08-03 09:57:04 +02:00
Chris Jerdonek 795051b2b0 Refs #32800 -- Added tests of more CSRF functions. 2021-08-03 07:16:31 +02:00
Chris Jerdonek 7132341255 Refs #32800 -- Renamed _compare_masked_tokens() to _does_token_match(). 2021-08-03 07:10:31 +02:00
Mariusz Felisiak 34d5336b9d Added test for TemplateSyntaxError when variables begin with underscores. 2021-08-02 11:37:39 +02:00
David Smith f9b7704ab3
Refs #32956 -- Corrected spelling of "gray". 2021-08-02 07:51:24 +02:00
David Smith 6802ac4415
Refs #32956 -- Corrected usage of "insure" and "assure". 2021-08-02 07:45:26 +02:00
David Smith fbb1984046
Refs #32956 -- Updated words ending in -wards.
AP styleguide: Virtually none of the words ending with -wards end with
an s.
2021-07-30 20:34:50 +02:00
Chris Jerdonek 542e749475 Fixed #32966 -- Fixed TimeField.check() crash for timezone-aware times in default when USE_TZ = True. 2021-07-30 09:15:39 +02:00
Jonathan Davis 4c6a6d5ac7
Fixed #23895 -- Prevented pickling of ResolverMatch.
Pickling a ResolverMatch did not work correctly in many cases,
especially with CBVs and URLResolvers in the list of tried URL paths.
2021-07-29 07:04:56 +02:00
David Smith 1024b5e74a Fixed 32956 -- Lowercased spelling of "web" and "web framework" where appropriate. 2021-07-29 06:24:12 +02:00
chrishna1 033636286a Fixed #32959 -- Moved tests URLs to validators.tests. 2021-07-28 11:39:36 +02:00
David Smith 1cba320786
Refs #32956 -- Changed "afterwards" to "afterward" in docs and comments.
This also removes unnecessary comments with the previous spelling.

AP Stylebook has a short entry to advise the preferred spelling for
"en-us". "Afterwards" is preferred in British English.
2021-07-27 10:41:51 +02:00
Jordan Bae 3d9040a50b Refs #32743 -- Fixed recreation of foreign key constraints when altering type of referenced primary key with MTI.
Follow up to 325d7710ce.
2021-07-27 07:30:33 +02:00
abhiabhi94 5a634a7b6f Fixed #32906 -- Added docs and tests for using key and index lookups on JSONBAgg results.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-26 11:23:51 +02:00
David Wobrock 325d7710ce Fixed #32743 -- Added foreign key altering when altering type of referenced primary key with MTI. 2021-07-26 08:51:56 +02:00
Tom Wojcik 20226fcd46 Fixed #32947 -- Fixed hash() crash on reverse M2M relation when through_fields is a list.
Regression in c32d8f33d8.
2021-07-26 06:09:29 +02:00
Virtosu Bogdan 00ea883ef5 Fixed #32329 -- Made CsrfViewMiddleware catch more specific UnreadablePostError.
Thanks Chris Jerdonek for the review.
2021-07-23 13:10:41 +02:00
Virtosu Bogdan 852fa7617e Refs #32329 -- Allowed specifying request class in csrf_tests test hooks. 2021-07-23 12:13:31 +02:00
Nick Pope 6b513f0137
Fixed #32913 -- Made watchman reloader tests less flaky. 2021-07-23 11:40:57 +02:00
Chris Jerdonek 3cfcb8cbc8 Refs #32902 -- Moved ensure_csrf_cookie_view after protected_view. 2021-07-23 07:09:36 +02:00
Chris Jerdonek a2e1f1e295 Fixed #32902 -- Fixed CsrfViewMiddleware.process_response()'s cookie reset logic.
Thanks Florian Apolloner and Shai Berger for reviews.
2021-07-23 07:08:45 +02:00
Chris Jerdonek 311401d9a2 Refs #32902 -- Added CSRF test when rotate_token() is called between resetting the token and processing response. 2021-07-23 06:56:53 +02:00
ryowright 1783b3cb24 Fixed #32275 -- Added scrypt password hasher.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-22 12:40:33 +02:00
Wu Haotian 65b880b726 Fixed #32930 -- Fixed URLValidator when port numbers < 10. 2021-07-22 11:58:28 +02:00
Wu Haotian b96cc7f85e Added more test cases with port numbers for URLValidator. 2021-07-22 11:58:28 +02:00
Mariusz Felisiak 83022d279c
Refs #32508 -- Raised TypeError/ValueError instead of using "assert" in encode() methods of some password hashers. 2021-07-22 09:42:07 +02:00
Nick Pope c35b81b864 Fixed #32951 -- Removed Query.where_class & co.
Unused since 3caf957ed5.
2021-07-22 08:49:20 +02:00
yakimka c542d0a072 Fixed #32949 -- Restored invalid number handling in DecimalField.validate().
DecimalField must itself validate() values, such as NaN, which cannot be
passed to validators, such as MaxValueValidator, during the
run_validators() phase.

Regression in cc3d24d7d5.
2021-07-21 10:20:24 +02:00
David Wobrock fd999318ad Fixed #32704 -- Fixed list of deferred fields when chaining QuerySet.defer() after only(). 2021-07-20 12:15:29 +02:00
David Wobrock 96706d76cd Added more tests for chaining QuerySet.defer() after only(). 2021-07-20 12:14:28 +02:00
Nick Pope fee8734596 Refs #10929 -- Deprecated forced empty result value for PostgreSQL aggregates.
This deprecates forcing a return value for ArrayAgg, JSONBAgg, and
StringAgg when there are no rows in the query. Now that we have a
``default`` argument for aggregates, we want to revert to returning the
default of ``None`` which most aggregate functions return and leave it
up to the user to decide what they want to be returned by default.
2021-07-19 13:41:16 +02:00
Nick Pope 501a8db465 Fixed #10929 -- Added default argument to aggregates.
Thanks to Simon Charette and Adam Johnson for the reviews.
2021-07-19 13:04:27 +02:00
Keryn Knight 59942a66ce Fixed #32941 -- Removed get_format_modules()'s unused reverse argument.
Unused since 0d8b523422.
2021-07-19 11:42:20 +02:00
Chris Jerdonek f3825ee050
Fixed wording of AuthViewsTestCase's docstring. 2021-07-19 06:36:20 +02:00
Jacob Walls 56f9579105 Fixed #32655 -- Deprecated extra_tests argument for DiscoverRunner.build_suite()/run_tests(). 2021-07-16 20:46:41 +02:00
Chris Jerdonek 0dc25526d8 Fixed #32924 -- Changed BaseForm.get_initial_for_field() to remove microseconds when needed. 2021-07-16 15:51:20 +02:00
Chris Jerdonek 788441c6ab Refs #32924 -- Changed test_initial_datetime_values() to use subTests. 2021-07-16 15:51:20 +02:00
Chris Jerdonek 469e769299 Refs #32924 -- Changed test_get_initial_for_field() to use subTests. 2021-07-16 15:51:20 +02:00
pochangl f6d3557aa1
Fixed #32929 -- Fixed handling query strings in AsyncRequestFactory. 2021-07-15 13:09:29 +02:00
Daniyal f479df7f8d Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.db.models.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-15 11:43:33 +02:00
Chris Jerdonek 90a33ab2ce Fixed #32920 -- Changed BaseForm to access its values through bound fields. 2021-07-15 10:47:02 +02:00
Ties Jan Hefting 84400d2e9d Fixed #32905 -- Added CSS class for non-form errors of formsets. 2021-07-15 07:00:39 +02:00
Carlton Gibson 3a45fea083 Fixed #21936 -- Allowed DeleteView to work with custom Forms and SuccessMessageMixin.
Thanks to Mariusz Felisiak for review.

Co-authored-by: Demetris Stavrou <demestav@gmail.com>
Co-authored-by: Caroline Simpson <github@hoojiboo.com>
2021-07-14 09:47:03 +02:00