Commit Graph

10768 Commits

Author SHA1 Message Date
Mariusz Felisiak 45bcc6feac
Refs #31115 -- Added test for nested subquery that references related fields.
Thanks Dmitriy Gunchenko for the report and Simon Charette for the
analysis and tests.

Regression in 5a4d7285bd.

Fixed in 5a4d7285bd.
2019-12-23 12:17:56 +01:00
Jon Dufresne 67ea35df52 Fixed #30998 -- Added ModelChoiceIteratorValue to pass the model instance to ChoiceWidget.create_option(). 2019-12-23 10:34:50 +01:00
Simon Charette 720de4d044 Fixed #31109 -- Disabled grouping by aliases on QuerySet.exists().
Clearing the SELECT clause in Query.has_results was orphaning GROUP BY
references to it.

Thanks Thierry Bastian for the report and Baptiste Mispelon for the
bisect.

Regression in fb3f034f1c.
2019-12-23 09:24:03 +01:00
Nick Pope a2d894b2e4 Refs #28954 -- Removed remaining Jython-specific code from dispatch tests.
Missed in 23b21db31b.
2019-12-19 16:42:12 +01:00
Hasan Ramezani a3fc24f014 Fixed #31095 -- Made RelatedManager.set() preserve existing m2m relations with an invalid type. 2019-12-19 13:33:05 +01:00
Simon Charette 5a4d7285bd Fixed #31094 -- Included columns referenced by subqueries in GROUP BY on aggregations.
Thanks Johannes Hoppe for the report.

Regression in fb3f034f1c.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-12-19 10:04:56 +01:00
Simon Charette a0f34d8fef Refs #31094 -- Added test for not using aliases in GROUP BY clauses. 2019-12-19 09:12:29 +01:00
Mike Hansen 35d36d9462 Refs #30585 -- Updated project templates and tests to use (block)translate tags. 2019-12-18 13:15:38 +01:00
Mike Hansen d291c72bf2 Fixed #30585 -- Added {% translate %} and {% blocktranslate %} template tags. 2019-12-18 13:15:38 +01:00
Simon Charette 5b1fbcef7a Fixed CVE-2019-19844 -- Used verified user email for password reset requests.
Co-Authored-By: Florian Apolloner <florian@apolloner.eu>
2019-12-18 09:11:39 +01:00
Shubham singh f4647179cc Fixed #31086 -- Improved error message for admin model inlines with more than one foreign key to the same parent. 2019-12-17 09:15:01 +01:00
James Turk ff00a05347 Fixed #31088 -- Added support for websearch searching in SearchQuery. 2019-12-16 14:59:59 +01:00
Zeynel Özdemir 9d40b6bbf4 Fixed #31076 -- Fixed dbshell crash on Windows with Python < 3.8.
subprocess.run()'s args parameter accepts path-like objects on Windows
since Python 3.8.
2019-12-16 11:20:41 +01:00
Baptiste Mispelon 4161e35048 Refs #12679 -- Added test for using property as ModelAdmin.inlines.
Fixed in 1d8eb0cae5.
2019-12-14 21:15:44 +01:00
Baptiste Mispelon 738e9e615d Fixed #26743 -- Fixed UnboundLocalError crash when deserializing m2m fields and value isn't iterable. 2019-12-13 11:38:09 +01:00
Osaetin Daniel b33bfc3839 Fixed #30862 -- Allowed setting SameSite cookies flags to 'none'.
Thanks Florian Apolloner and Carlton Gibson for reviews.
2019-12-12 10:52:31 +01:00
Baptiste Mispelon 200cd8803d Refs #25361 -- Added test for pickling queryset of abstract-inherited models with Meta.ordering.
Fixed in 67cf5efa31.
2019-12-12 09:01:47 +01:00
Jon Dufresne 8ea3ff155e Fixed typo in tests/cache/tests.py docstring. 2019-12-11 17:39:21 +01:00
Jon Dufresne 8d087f9a17 Fixed typo in ModelChoiceFieldTests.
The subindex and attrs arguments should be passed through to the parent,
not overridden as None.
2019-12-11 15:15:12 +01:00
Jon Dufresne e703b93a65 Fixed #31080 -- Removed redundant type="text/javascript" attribute from <script> tags. 2019-12-11 09:49:54 +01:00
Baptiste Mispelon d8e2333528 Fixed #31077 -- Made debug decorators raise TypeError if they're not called.
Django will raise an error if you forget to call the decorator.
2019-12-10 13:34:28 +01:00
Peter Andersen 02eff7ef60 Fixed #31073 -- Prevented CheckboxInput.get_context() from mutating attrs. 2019-12-10 12:27:50 +01:00
Mariusz Felisiak 3fb7c12158
Refs #23433 -- Fixed test_django_admin_py.DeprecationTest tests failures on Windows and Python < 3.8.
subprocess.run()'s args parameter accepts a path-like object on Windows
since Python 3.8.
2019-12-10 11:17:50 +01:00
Baptiste Mispelon 3df3c5e670 Fixed #26480 -- Fixed crash of contrib.auth.authenticate() on decorated authenticate() methods of authentication backends.
The Signature API (PEP 362) has better support for decorated functions
(by default, it follows the __wrapped__ attribute set by
functools.wraps for example).
2019-12-10 09:36:30 +01:00
Mariusz Felisiak d6505273cd Refs #31044 -- Fixed error message when using Prefetch with a values_list() queryset. 2019-12-09 15:45:53 +01:00
Hasan Ramezani 4540842bc3 Fixed #31044 -- Errored nicely when using Prefetch with a raw() queryset. 2019-12-09 15:45:18 +01:00
Baptiste Mispelon 9e565386d3 Fixed #27430 -- Added -b/--buffer option to DiscoverRunner. 2019-12-09 13:47:12 +01:00
Mariusz Felisiak f464526388
Refs #30676 -- Added test for invalid --pdb and --parallel usage in DiscoverRunner. 2019-12-09 11:12:06 +01:00
Alex Aktsipetrov bf12273db4 Fixed #31060 -- Reallowed window expressions to be used in conditions outside of queryset filters.
Regression in 4edad1ddf6.

Thanks utapyngo for the report.
2019-12-06 13:52:16 +01:00
Jon Dufresne 5708327c37 Fixed #23433 -- Deprecated django-admin.py entry point in favor of django-admin.
Unify on the entry point created by setuptools entry_points feature.
2019-12-06 12:11:44 +01:00
Jon Dufresne 8eb0f73eed Refs #23433 -- Removed script argument from AdminScriptTestCase.run_test(). 2019-12-06 10:33:54 +01:00
Jon Dufresne 8aefe11137 Removed unnecessary __init__.py creation in admin_scripts.tests. 2019-12-06 09:57:09 +01:00
Mariusz Felisiak 82a88d2f48
Fixed #31061 -- Ignored positional args in django.urls.resolve() when all optional named parameters are missing.
Regression in 76b993a117.

Thanks Claude Paroz for the report and Carlton Gibson for reviews.
2019-12-06 09:32:51 +01:00
Hasan Ramezani 5d674eac87 Fixed #31039 -- Added support for contained_by lookup with AutoFields, SmallIntegerField, and DecimalField. 2019-12-05 15:50:39 +01:00
Carlton Gibson 6410d38ca7
Moved selenium import to nested scope. 2019-12-05 12:47:31 +01:00
Gordon Pendleton adb9661789 Fixed #31010 -- Allowed subdomains of localhost in the Host header by default when DEBUG=True. 2019-12-05 09:44:45 +01:00
Aymeric Augustin c06492dd87 Fixed #23524 -- Allowed DATABASES['TIME_ZONE'] option on PostgreSQL. 2019-12-04 18:22:08 +01:00
Baptiste Mispelon 26cab4e8c1 Fixed #31046 -- Allowed RelatedManager.add()/create()/set() to accept callable values in through_defaults. 2019-12-03 19:47:38 +01:00
Andrew Godwin c90ab30fa1 Fixed #31056 -- Allowed disabling async-unsafe check with an environment variable. 2019-12-03 17:29:31 +01:00
Jon Dufresne 65285d1e7d Refs #29892 -- Made Selenium tests wait for popups to be ready. 2019-12-02 15:06:36 +01:00
Mariusz Felisiak 845042b3d9
Refs #25705 -- Fixed invalid SQL generated by SQLFuncMixin.as_sql() in custom_lookups tests.
Generated SQL was invalid because parameters are quoted by a driver.
2019-12-02 13:58:41 +01:00
Carlton Gibson 11c5e0609b Fixed CVE-2019-19118 -- Required edit permissions on parent model for editable inlines in admin.
Thank you to Shen Ying for reporting this issue.
2019-12-02 08:56:08 +01:00
Mariusz Felisiak 0107e3d105
Fixed #30953 -- Made select_for_update() lock queryset's model when using "self" with multi-table inheritance.
Thanks Abhijeet Viswa for the report and initial patch.
2019-12-02 07:57:19 +01:00
Carlton Gibson c33eb6dcd0
Fixed #29892 -- Added explicit Selenium wait in admin autocomplete tests. 2019-11-29 14:03:22 +01:00
Baptiste Mispelon f47ba7e780 Fixed #30255 -- Fixed admindocs errors when rendering docstrings without leading newlines.
Used inspect.cleandoc() which implements PEP-257 instead of an internal
hook.
2019-11-29 12:47:42 +01:00
Mariusz Felisiak e8fcdaad5c Fixed #31021 -- Fixed proxy model permissions data migration crash with a multiple databases setup.
Regression in 98296f86b3.
2019-11-29 08:23:01 +01:00
Jon Dufresne 86a0231e0a Refs #23919 -- Replaced super(...) with super() in metaclasses. 2019-11-28 15:34:29 +01:00
Jon Dufresne c8bd37a860 Fixed #31042 -- Removed AdminSeleniumTestCase.get_css_value() in favor of Selenium .is_displayed().
All instances of AdminSeleniumTestCase.get_css_value() were used to
inspect the display property.
2019-11-28 15:10:13 +01:00
Jon Dufresne 875e3ff4fd Fixed #29892 -- Added .wait_page_loaded() in SeleniumTests.test_first_field_focus(). 2019-11-28 11:22:19 +01:00
Jon Dufresne f0ed38edf3 Refs #29892 -- Replaced Selenium .submit() shim with .click() on the submit button.
There is no WebDriver submit primitive. The Selenium project implements
it as a convenience only. The geckodriver developers recommend against
using it. Replace it with a real primitive, click on the submit button.

Fixes failing Seleninum test test_date_time_picker_shortcuts when using
the Firefox Selenium driver.
2019-11-28 09:24:19 +01:00
Johannes Hoppe 249a6190ae Fixed #30975 -- Replaced custom get_select_option with Selenium's select_by_value. 2019-11-27 16:34:07 +01:00
Johannes Hoppe 69dbb6b708 Fixed #30973 -- Converted selenium tests wait_page_loaded to context manager. 2019-11-27 14:36:26 +01:00
Hasan Ramezani 8d32290279 Fixed #30425 -- Handled jinja2.TemplateSyntaxError when rendering a template.
Jinja raises jinja2.TemplateSyntaxError in render() not in
get_template() when it's in an included template.
2019-11-27 12:48:07 +01:00
Farhaan Bukhsh 1f817daa20 Fixed #30803 -- Allowed comma separators for milliseconds in django.utils.dateparse functions.
Co-Authored-By: Ben Wilber <benwilber@gmail.com>
2019-11-27 09:43:12 +01:00
Farhaan Bukhsh 42b23d1e79 Refs #30803 -- Allowed comma separators for decimal fractions in parse_duration(). 2019-11-27 09:43:12 +01:00
Baptiste Mispelon 52936eface Fixed #31031 -- Fixed data loss in admin changelist view when formset's prefix contains regex special chars.
Regression in b18650a263.
2019-11-26 08:48:10 +01:00
Simon Charette 0290e01d5a Fixed #31002 -- Fixed GIS lookups crash against a subquery annotation.
Thanks Vasileios Bouzas for the report.
2019-11-25 12:30:33 +01:00
John Bowen 29d8198841 Fixed #27914 -- Fixed serialization of nested classes in migrations. 2019-11-25 11:12:44 +01:00
John Bowen 8008795a38 Refs #23950 --- Moved test DeconstructibleInstances class to a module level.
DeconstructibleInstances was not importable from the asserted path.
2019-11-25 11:05:09 +01:00
Sergey Fedoseev a5855c8f0f Fixed #30996 -- Added AsWKB and AsWKT GIS functions. 2019-11-22 13:40:48 +01:00
Baptiste Mispelon 8929afb8ec Fixed #9762 -- Made DateFormat.r() locale-independent.
Thanks to Antonio Melé for the original report all those years ago
and to all the contributors who helped along the way.
2019-11-22 12:41:53 +01:00
Baptiste Mispelon 76ec032712 Refs #26281 -- Added a helpful error message for an invalid "r" specifier to dateformat.format(). 2019-11-22 12:32:30 +01:00
Simon Charette 379bf1a2d4 Fixed #8467 -- Prevented crash when adding existent m2m relation with an invalid type.
This was an issue anymore on backends that allows conflicts to be
ignored (Refs #19544) as long the provided values were coercible to the
expected type. However on the remaining backends that don't support
this feature, namely Oracle, this could still result in an
IntegrityError.

By attempting to coerce the provided values to the expected types in
Python beforehand we allow the existing value set intersection in
ManyRelatedManager._get_missing_target_ids to prevent the problematic
insertion attempts.

Thanks Baptiste Mispelon for triaging this old ticket against the
current state of the master branch.
2019-11-22 09:08:10 +01:00
Simon Charette 8cc711999a Refs #8467 -- Added test for RelatedManager.add()/remove() with an invalid type. 2019-11-22 09:04:03 +01:00
Carlton Gibson ee4a19053a Fixed #31012 -- Reverted "Fixed #29056 -- Fixed HTML5 validation of required SelectDateWidget."
This reverts commit f038214d91.

The initial issue was incorrect. Django 2.2, and before, did not
generate invalid HTML as reported. With f03821 in place invalid HTML
was generated.

Thanks to Kevin Brown for follow-up report and investigation.
2019-11-21 20:53:31 +01:00
Farhaan Bukhsh 664c98f1f8 Fixed #30413 -- Fixed test database signature on SQLite when test database name is provided.
Previously, the same signature was created for multiple in-memory
databases on SQLite when they had tests databases names
DATABASES['TEST']['NAME'].
2019-11-21 19:50:24 +01:00
Simon Charette f97a6123c0 Refs #25367 -- Made Query.build_filter() raise TypeError on non-conditional expressions. 2019-11-21 11:56:35 +01:00
Simon Charette e9a0e1d4f6 Fixed #30484 -- Added conditional expressions support to CheckConstraint. 2019-11-21 11:56:35 +01:00
Simon Charette 306b687520 Refs #11964 -- Removed SimpleCol in favor of Query(alias_cols).
This prevent having to pass simple_col through multiple function calls
by defining whether or not references should be resolved with aliases
at the Query level.
2019-11-21 11:56:35 +01:00
Jon Dufresne f5ebdfce5c Fixed #25388 -- Added an option to allow disabling of migrations during test database creation. 2019-11-20 20:42:38 +01:00
Carlton Gibson 36453526d3
Pinned asgiref version. 2019-11-20 14:57:08 +01:00
Hasan Ramezani 0284a26af9 Fixed #30981 -- Fixed admin changelist crash when using F() or OrderBy() expressions in admin_order_field. 2019-11-19 15:40:04 +01:00
Daniel Izquierdo 89abecc75d Fixed #27272 -- Added an on_delete RESTRICT handler to allow cascading deletions while protecting direct ones. 2019-11-19 10:55:05 +01:00
Caio Ariede 555bebe774 Fixed #30987 -- Added models.PositiveBigIntegerField. 2019-11-19 09:34:11 +01:00
Jon Dufresne aa12cf07c9 Removed unnecessary numeric indexes in format strings. 2019-11-19 08:29:47 +01:00
Sergey Fedoseev f95b59a1b3 Fixed #30994 -- Added Oracle support for AsGeoJSON GIS function. 2019-11-18 15:32:44 +01:00
Jon Dufresne 7f0946298e Replaced encode() usage with bytes literals. 2019-11-18 15:31:42 +01:00
Jon Dufresne 57a3d96ff5 Replaced unnecessary str()/bytes() calls with literals. 2019-11-18 15:30:10 +01:00
Jon Dufresne e649d691f8 Removed unnecessary parentheses in various code. 2019-11-18 15:25:59 +01:00
Simon Charette 11e327a3ff Fixed #30988 -- Deprecated the InvalidQuery exception.
It was barely documented without pointers at its defining location and
was abused to prevent misuse of the QuerySet field deferring feature.
2019-11-18 14:06:51 +01:00
Tim Graham 9100c664db Relaxed some query ordering assertions in tests.
It accounts for differences seen on cockroachdb.
2019-11-18 12:32:37 +01:00
Baptiste Mispelon 18e10740a4 Refs #30990 -- Added test for 'z' date format with a leap year. 2019-11-18 11:30:18 +01:00
Mariusz Felisiak 8685e764ef Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL expressions on Oracle. 2019-11-18 08:50:09 +01:00
Tim Graham 22a7a406c9 Removed hardcoded pk in view_tests.tests.test_defaults. 2019-11-18 08:46:39 +01:00
Tim Graham 7f61b6b039 Removed hardcoded pk in test_pk_set_on_repeated_add_remove.
Follow up to bed4a1527b.
2019-11-18 08:46:39 +01:00
Mariusz Felisiak 4527d5db0f
Refs #29808 -- Fixed MigrateTests.test_migrate_fake_initial_case_insensitive() crash on Oracle. 2019-11-15 21:05:42 +01:00
Hasan Ramezani 530dd193f2 Fixed #29808 -- Fixed initial migration detection when identifiers are case-insensitive.
Thanks Simon Charette for the review.
2019-11-15 09:01:30 +01:00
Dulmandakh 24b9f50823 Fixed #29916 -- Added lower_inc, lower_inf, upper_inc, and upper_inf lookups for RangeFields.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-11-14 22:27:29 +01:00
daniel a rios efc3e32d6d Fixed #30759 -- Made cache.delete() return whether it succeeded.
Thanks Simon Charette for the review.
2019-11-14 11:14:11 +01:00
Mariusz Felisiak ca0d50f34a Fixed random auth_tests.test_tokens.TokenGeneratorTest.test_10265 failures.
Random failures depended on the current timestamp.
2019-11-13 14:22:23 +01:00
Mariusz Felisiak 3b4b36fb1d Moved MockedPasswordResetTokenGenerator outside of TokenGeneratorTest.test_timeout(). 2019-11-13 14:22:23 +01:00
George Marshall 8be79984dc Fixed #30971 -- Prevented Query.resolve_lookup_value() from coercing list values to tuples.
Regression in 8a281aa7fe.
2019-11-13 08:27:26 +01:00
Hasan Ramezani 4b78546ef1 Fixed #30405 -- Fixed source code mismatch crash in ExceptionReporter. 2019-11-12 11:31:12 +01:00
Hannes Ljungberg 6e2f05b2e3 Fixed #30967 -- Fixed TrigramTest failures on PostgreSQL 12+. 2019-11-11 12:58:49 +01:00
Hasan Ramezani 153c7956f8 Fixed #24858 -- Added support for get_FOO_display() to ArrayField and RangeFields.
_get_FIELD_display() crashed when Field.choices was unhashable.
2019-11-08 10:59:24 +01:00
Hannes Ljungberg 6d590bcf1f Fixed #30961 -- Fixed spaces in columns list SQL generated for indexes. 2019-11-08 08:52:47 +01:00
Hannes Ljungberg d5af43c8d1 Refs #30961 -- Added tests for columns list SQL generated for indexes. 2019-11-08 08:35:39 +01:00
Nick Pope 02983c5242 Fixed #30943 -- Added BloomIndex to django.contrib.postgres. 2019-11-07 11:23:53 +01:00
Jon Dufresne 77aa74cb70 Refs #29983 -- Added support for using pathlib.Path in all settings. 2019-11-07 10:26:22 +01:00
Jon Dufresne 39791c8e6d Harmonized Windows checks in tests to a single style. 2019-11-06 15:14:30 +01:00
Jon Dufresne e3c2fae4cd Adjusted expected exception message for Windows.
Test failure introduced in fbbff7f808.

Windows uses a different error message when a non-path is passed to
os.path functions.
2019-11-06 14:34:44 +01:00
Jon Dufresne 74f2a58b3a Refs #29983 -- Added tests for FileBasedCache pathlib support. 2019-11-06 10:01:01 +01:00
Jon Dufresne fbbff7f808 Refs #29983 -- Added pathlib.Path support to the file email backend. 2019-11-06 09:33:07 +01:00
Stephen Rauch 4b6db766ba Refs #30183 -- Doc'd dropping support for sqlparse < 0.2.2.
Support for sqlparse < 0.2.2 was broken in
782d85b6df because is_whitespace property
was added in sqlparse 0.2.2.
2019-11-06 08:45:43 +01:00
Jon Dufresne 1c4c68dfed Refs #29983 -- Added test for FILE_UPLOAD_TEMP_DIR pathlib support. 2019-11-06 08:20:23 +01:00
Jon Dufresne 92e5abd7a3 Refs #29983 -- Added test for FIXTURES_DIRS pathlib support. 2019-11-06 08:06:55 +01:00
Jon Dufresne edeec1247e Passed strict=True to Path.resolve() to enforce that the path must exist. 2019-11-05 14:22:20 +01:00
Hasan Ramezani 47379d027b Fixed #30095 -- Fixed system check for RangeField/ArrayField.choices with lists and tuples. 2019-11-05 11:48:44 +01:00
Jon Dufresne e0e88ceaaa Refs #30116 -- Simplified stdout/stderr decoding with subprocess.run()'s encoding argument.
The encoding argument has been available since Python 3.6.
https://docs.python.org/3/library/subprocess.html#subprocess.run
2019-11-04 11:21:25 +01:00
Jon Dufresne 607004f81a Simplified consecutive calls to pathlib.Path.parent. 2019-11-04 09:59:34 +01:00
Carlton Gibson 2d38eb0ab9 Fixed #30931 -- Restored ability to override Model.get_FIELD_display().
Thanks Sergey Fedoseev for the implementation idea.

Regression in a68ea23101.
2019-11-04 07:55:34 +01:00
Hasan Ramezani 8463390527 Refs #27808 -- Added test for saving nested ArrayField with nullable base field. 2019-11-01 15:56:21 +01:00
Sky 3cf907c20c Fixed #30761 -- Prevented floatformat filter from returning a negative zero. 2019-10-31 10:48:35 +01:00
Sky 459de8dc29 Added more tests for floatformat filter with negative values. 2019-10-31 10:07:59 +01:00
Hasan Ramezani 17752003a8 Refs #28428 -- Made FileSystemStorage.save() to support pathlib.Path. 2019-10-31 09:06:05 +01:00
Hasan Ramezani 0f2975534d Refs #28428 -- Added tests for using FileSystemStorage with pathlib.Path. 2019-10-31 08:52:15 +01:00
Felipe Lee c2c27867ef Refs #20456 -- Moved initialization of HEAD method based on GET to the View.setup() for generic views.
This will ease unit testing of views since setup will essentially do
everything needed to set the view instance up (other than instantiating
it). Credit for idea goes to Vincent Prouillet.
2019-10-30 14:43:52 +01:00
Felipe Lee 31d1822532 Refs #20456 -- Added test for initialization of request/args/kwargs attributes in View.Setup(). 2019-10-30 14:43:47 +01:00
Hasan Ramezani 6315a272c5 Refs #28428 -- Made filepath_to_uri() support pathlib.Path. 2019-10-30 13:13:15 +01:00
Nick Pope 7552de7866 Used more specific unittest assertions in tests.
* assertIsNone()/assertIsNotNone() instead of comparing to None.
* assertLess() for < comparisons.
* assertIs() for 'is' expressions.
* assertIsInstance() for isinstance() expressions.
* rounding of assertAlmostEqual() for round() expressions.
* assertIs(..., True/False) instead of comparing to True/False.
* assertIs()/assertIsNot() for ==/!= comparisons.
* assertNotEqual() for == comparisons.
* assertTrue()/assertFalse() instead of comparing to True/False.
2019-10-29 12:37:30 +01:00
Erwin Junge a6cb8ec389 Fixed #30922 -- Fixed ModelAdmin.date_hierarchy queries with DST changes.
There was an issue where admin date_hierarchy didn't render last day of
a month in DST-switch month.
2019-10-29 11:21:03 +01:00
Hasan Ramezani 6c6d24a4fe Refs #30908 -- Added test for nonexistent path in forms.FilePathField. 2019-10-29 08:39:56 +01:00
Hasan Ramezani 52cb419072 Fixed #30918 -- Made timesince()/timeuntil() respect custom time strings for future and the same datetimes. 2019-10-28 12:28:18 +01:00
Pavel Dedik 711a7d4d50 Fixed #30907 -- Fixed SplitArrayField.has_changed() with removal of empty trailing values. 2019-10-28 10:32:34 +01:00
Pavel Dedik d95b1ddcbe Refs #30907 -- Added more tests for SplitArrayField.has_changed(). 2019-10-28 10:32:05 +01:00
Sergey Fedoseev 6bbf9a20e2 Fixed #29770 -- Added LinearRing.is_counterclockwise property. 2019-10-25 14:28:26 +02:00
Carlton Gibson 24e540fbd7 Fixed #29087 -- Added delete buttons for unsaved admin inlines on validation error. 2019-10-25 13:28:08 +02:00
Carlton Gibson dbcd7b064e Fixed #30902 -- Added __str__() for model choice enums.
Allows expected behavior when cast to str, also matching behaviour of
created instances with those fetched from the DB.

Thanks to Simon Charette, Nick Pope, and Shai Berger for reviews.
2019-10-25 09:19:56 +02:00
Nick Pope 55df1750be Refs #30897 -- Added support for ANALYZE option to Queryset.explain() on MariaDB and MySQL 8.0.18+. 2019-10-24 15:13:26 +02:00
Nick Pope 742961332e Refs #30897 -- Added support for TREE format to Queryset.explain() on MySQL 8.0.16+. 2019-10-24 15:13:23 +02:00
Simon Charette 7acef095d7 Fixed #23576 -- Implemented multi-alias fast-path deletion in MySQL backend.
This required moving the entirety of DELETE SQL generation to the
compiler where it should have been in the first place and implementing
a specialized compiler on MySQL/MariaDB.

The MySQL compiler relies on the "DELETE table FROM table JOIN" syntax
for queries spanning over multiple tables.
2019-10-24 12:24:53 +02:00
Carlton Gibson e83c300a33 Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.
Refs https://bugs.python.org/issue38563.
2019-10-24 10:43:05 +02:00
Hannes Ljungberg fa5f3291e7 Fixed #30903 -- Fixed migrations crash on PostgreSQL when adding Index with opclasses and ordering. 2019-10-24 09:33:14 +02:00
Mariusz Felisiak 25903e41fb Refs #29926 -- Bumped minimum tblib version to 1.5.0 in test requirements. 2019-10-23 15:26:04 +02:00
Mariusz Felisiak e10ebf43e1
Bumped minimum Pillow version to 6.2.0 in test requirements.
Pillow < 6.2.0 is vulnerable to CVE-2019-16865.
2019-10-23 15:07:06 +02:00
Nick Pope 6e9189c080 Refs #30897 -- Added test for SETTINGS option to Queryset.explain() on PostgreSQL 12+. 2019-10-23 14:07:18 +02:00
Nick Pope a5c5ae7d91 Refs #28574 -- Used feature flag for PostgreSQL version check. 2019-10-23 14:07:13 +02:00
Dan Moore bc94e3c1a2 Fixed #29919 -- Fixed RelatedOnlyFieldListFilter crash with reverse relationships. 2019-10-23 10:50:31 +02:00
Dan Moore f3855a8d2d Added tests for Field.get_choices()'s limit_choices_to argument. 2019-10-23 10:47:17 +02:00
Sergey Fedoseev d4e767911f Added tests for middlewares' checks. 2019-10-23 08:18:02 +02:00
Mariusz Felisiak 2847d2c760
Refs #29926 -- Skipped RemoteTestResultTest.test_add_failing_subtests() on Python 3.8+ and tblib <= 1.4.0. 2019-10-22 15:34:19 +02:00
Alex Aktsipetrov 681f7e2b13 Fixed #20577 -- Deferred filtering of prefetched related querysets.
Added internal interface to QuerySet that allows to defer next filter
call till .query is accessed. Used it to optimize prefetch_related().

Thanks Simon Charette for the review.
2019-10-21 13:21:54 +02:00
Ahmet Kucuk 09578f6dfb Fixed #30827 -- Made batch_size arg of QuerySet.bulk_create() respect DatabaseOperations.bulk_batch_size().
Thanks Chetan Khanna for tests.
2019-10-21 11:46:44 +02:00
André Ericson 3120490912 Fixed #30876 -- Moved classproperty() decorator to the django.utils.functional. 2019-10-21 09:57:39 +02:00
André Ericson 31174031f1 Fixed #30841 -- Deprecated using non-boolean values for isnull lookup. 2019-10-21 08:44:20 +02:00
Jon Dufresne 2f72480fbd Replaced deprecated assertEquals() with assertEqual(). 2019-10-21 07:52:17 +02:00
Pavel Savchenko 1711c509fa Fixed #27391 -- Implemented SimpleTestCase.debug().
debug() should bubbled up exceptions if occurring in test, but behave
the same as run() when no exceptions occurred.
2019-10-18 12:22:51 +02:00
Pavel Savchenko dc8cd2fefd Refs #27391 -- Added more tests for SimpleTestCase. 2019-10-18 11:11:34 +02:00
Patrick Jenkins 46e74a5256 Fixed #28337 -- Preserved extra headers of requests made with django.test.Client in assertRedirects().
Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2019-10-18 08:42:51 +02:00
Daniel Musketa 3ca9df51c7 Fixed typo in tests/admin_scripts/tests.py. 2019-10-18 07:50:59 +02:00
Mariusz Felisiak 3a8af298b9 Fixed #30890 -- Added MariaDB support for the relate lookup. 2019-10-18 07:46:31 +02:00
Mariusz Felisiak bebf61de11 Added gis_tests.utils.mariadb hook. 2019-10-18 07:46:31 +02:00
Hasan Ramezani ef4beafa2c Refs #28816 -- Prevented silencing data loss when decreasing CharField.max_length for ArrayField.base_field on PostgreSQL. 2019-10-17 12:50:53 +02:00
sage 6f82df69ef Refs #12990 -- Moved CheckFieldDefaultMixin to the django.db.models.fields.mixins. 2019-10-17 12:30:29 +02:00
Mariusz Felisiak 1877ec1875
Refs #27910 -- Added __init__.py file for model_enums tests. 2019-10-15 21:27:22 +02:00
Carlton Gibson 1de9a92295 Fixed #30872 -- Improved unknown command message when settings are manually configured. 2019-10-15 13:04:32 +02:00
Mariusz Felisiak 06d34aab7c Fixed #30870 -- Fixed showing that RunPython operations are irreversible by migrate --plan.
Thanks Hasan Ramezani for the initial patch and Kyle Dickerson for the
report.
2019-10-14 11:13:27 +02:00
Mariusz Felisiak 05186c03a3 Isolated migrations.test_commands.MigrateTests.test_migrate_plan. 2019-10-14 08:42:38 +02:00
Simon Charette 2839659b42 Fixed #30868 -- Prevented unnecessary AlterField when renaming a referenced pk.
Regression introduced by dcdd219ee1, refs #25817.

Thanks Carlos E. C. Leite for the report and Mariusz for the bisect.
2019-10-14 08:02:26 +02:00
Etienne Chové e7cdb0cd7e Fixed #30014 -- Fixed ModelChoiceField validation when initial value is a model instance.
Thanks Carlton Gibson for reviews.
2019-10-11 13:28:09 +02:00
Etienne Chové a12f9cd95a Added ModelChoiceField test for validation with to_field_name. 2019-10-11 13:28:06 +02:00
Louise Grandjonc 7d1bf29977 Fixed #30826 -- Fixed crash of many JSONField lookups when one hand side is key transform.
Regression in 6c3dfba892.
2019-10-11 10:55:22 +02:00
Hasan Ramezani 6a75cea76a Fixed #30854 -- Fixed QuerySet.select_related() with multiple FilteredRelations. 2019-10-11 08:10:48 +02:00
Flavio Curella ed112fadc1 Fixed #23755 -- Added support for multiple field names in the no-cache Cache-Control directive to patch_cache_control().
https://tools.ietf.org/html/rfc7234#section-5.2.2.2
2019-10-10 19:30:51 +02:00
Flavio Curella 9facc90020 Refs #23755 -- Added tests for patch_cache_control() with no-cache Cache-Control directive. 2019-10-10 12:24:52 +02:00
Viktor Lomakin ee6b17187f Fixed #30812 -- Made ConditionalGetMiddleware set ETag only for responses with non-empty content. 2019-10-10 09:51:05 +02:00
Benjy Weinberger 3cd3bebe89 Fixed #30300 -- Allowed migrations to be loaded from directories without __init__.py file. 2019-10-10 08:31:41 +02:00
Simon Charette 26c66f4519 Fixed #30856 -- Combined fast-delete queries by model during cascade deletion.
Reduced the number of queries required when performing cascade deletion
for a model referenced multiple time by another one by performing an
union of reference lookups.
2019-10-09 09:49:53 +02:00
Hasan Ramezani a28d1b38e5 Fixed #30839 -- Fixed Field.__deepcopy__() so forms don't share error messages. 2019-10-08 10:07:05 +02:00
Hasan Ramezani 6452112640 Refs #27914 -- Fixed serialization of nested enum.Enum classes in migrations. 2019-10-03 08:39:30 +02:00
Hasan Ramezani d3030deaaa Refs #27914 -- Moved test enum.Enum subclasses outside of WriterTests.test_serialize_enums(). 2019-10-03 08:39:30 +02:00
Min ho Kim 103a6f4307 Fixed some typos in comments and docs.
Thanks to Mads Jenson for review.
2019-10-02 15:50:46 +02:00
Anatol Ulrich 8ed6788aa4 Fixed #30821 -- Added ExtractIsoWeekYear database function and iso_week_day lookup. 2019-10-02 10:41:34 +02:00
Tanner Stirrat 17595407ca Fixed #14218 -- Added Paginator.__iter__(). 2019-10-02 09:49:31 +02:00
ElizabethU 54ea290e5b Fixed #30651 -- Made __eq__() methods return NotImplemented for not implemented comparisons.
Changed __eq__ to return NotImplemented instead of False if compared to
an object of the same type, as is recommended by the Python data model
reference. Now these models can be compared to ANY (or other objects
with __eq__ overwritten) without returning False automatically.
2019-10-01 17:58:19 +02:00
Mariusz Felisiak 6475e6318c Refs #30651 -- Added tests for Prefetch.__eq__(). 2019-10-01 17:35:55 +02:00
Mariusz Felisiak 0d4b40fe66 Refs #30651 -- Added tests for Message.__eq__(). 2019-10-01 17:35:55 +02:00
Ahmet Kucuk dc890bef5a Fixed #30510 -- Fixed crash of QuerySet.bulk_create() with mixed-length texts on Oracle.
Text with more than 4000 characters must be set to as a CLOB on Oracle
what caused a mixed datatype error (ORA-01790) when shorter text
appeared in the same operation.
2019-10-01 12:38:58 +02:00
Ad Timmering 7b5f8acb9e Fixed #28690 -- Fixed handling of two-digit years in parse_http_date().
Due to RFC7231 ayear that appears to be more than 50 years in the
future are interpreted as representing the past.
2019-09-30 14:42:56 +02:00
Ad Timmering 7cbd25a06e Refs #28690 -- Added more tests for parse_http_date(). 2019-09-30 14:42:51 +02:00
Hasan Ramezani f0adf3b9b7 Fixed #30774 -- Made serialization in migrations use members names for Enums. 2019-09-30 10:28:05 +02:00
pablo fa8fe09e4e Fixed #30802 -- Prevented manifest creation when running collectstatic in dry run mode. 2019-09-27 23:01:41 +02:00
Hasan Ramezani 95a11578ce Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.
Regression in 440505cb2c.
2019-09-27 14:22:31 +02:00
Hasan Ramezani c7944628a1 Refs #30798 -- Prevented chaining fields from the same related model multiple times in model Meta.ordering. 2019-09-27 13:57:22 +02:00
Pablo García 2fd610eb30 Fixed #30810 -- Fixed WatchmanReloaderTests.test_setting_timeout_from_environment_variable test.
client_timeout is an instance attribute.
2019-09-27 08:09:05 +02:00
Oleg Kainov c574bec092 Fixed #25598 -- Added SCRIPT_NAME prefix to STATIC_URL and MEDIA_URL set to relative paths.
Thanks Florian Apolloner for reviews.

Co-authored-by: Joel Dunham <Joel.Dunham@technicalsafetybc.ca>
2019-09-25 19:47:03 +02:00
Mariusz Felisiak 580e644f24
Fixed #30800 -- Fixed migrations crash when altering a field with custom db_type().
Regression in 1378d665a1.
2019-09-25 12:32:24 +02:00
Maxim Kurnikov ff5dfbc63a Fixed false positive tests of Paginator.count property. 2019-09-25 09:15:18 +02:00
Mads Jensen 129583a0d3 Removed some outdated backwards compatibility imports and misleading comments.
EmptyResultSet moved in 46509cf13d.
FieldDoesNotExist moved in 8958170755.
BoundField and pretty_name moved in 8550161e53.
EMPTY_VALUES moved in 471596fc1a.
BaseRunserverCommand moved in 5c53e30607.
2019-09-24 15:18:53 +02:00
Mariusz Felisiak 01104368ff Refs #29444 -- Removed redundant DatabaseFeatures.can_return_multiple_columns_from_insert.
Unnecessary since b31e63879e.
2019-09-24 10:37:22 +02:00
Simon Charette 37f8f29377 Fixed #30796 -- Prevented select_related() from mutating a queryset on chaining.
Thanks Darren Maki for the report.
2019-09-24 09:17:45 +02:00
Hasan Ramezani f97bbad908 Fixed #13296 -- Fixed ordering by Options.order_with_respect_to after deleting objects.
Thanks Simon Meers for the original patch.
2019-09-23 11:20:37 +02:00
Ian Foote d9881a025c Fixed #29915 -- Added support for values with hyphens to pattern lookups for UUIDField on backends without UUID datatype.
Support hyphens in iexact, contains, icontains, startswith, istartswith,
endswith and iendswith UUIDField filters on backends without UUID
datatype.
2019-09-23 08:24:08 +02:00
Ian Foote 485f65b3c0 Refs #29915 -- Added tests for using pattern lookups with values without hyphens for UUIDField. 2019-09-23 08:24:00 +02:00
Claude Paroz 9d5a487f33 Dropped obsolete mimetype kwarg in csrf test view 2019-09-21 20:46:39 +02:00
Hasan Ramezani 226ebb1729 Fixed #28622 -- Allowed specifying password reset link expiration in seconds and deprecated PASSWORD_RESET_TIMEOUT_DAYS. 2019-09-20 13:52:04 +02:00
James Timmins 0719edcd5f Fixed #30771 -- Fixed exact lookup against queries with selected columns.
Use pre-existing select fields (and thereby GROUP BY fields) from
subquery if they were specified, instead of always defaulting to pk.

Thanks Aur Saraf for the report and Simon Charette for guidance.
2019-09-20 10:42:14 +02:00
Carlton Gibson bed4a1527b Refs #27462 -- Added tests of pk_set in m2m_changed signal receivers for repeated add/remove calls. 2019-09-19 11:34:59 +02:00
Daniel Fairhead 5cb3ed187b Fixed #30772 -- Optimized make_template_fragment_key().
Removed usage of urllib.quote(), unnecessary since cbbe60c7fc.
Used hasher's .update() on key fragments.
2019-09-18 14:53:05 +02:00
Sam Reynolds 6c9778a58e Fixed #30776 -- Restored max length validation on AuthenticationForm.UsernameField.
Regression in 5ceaf14686.

Thanks gopackgo90 for the report and Mariusz Felisiak for tests.
2019-09-18 11:37:38 +02:00