Commit Graph

11422 Commits

Author SHA1 Message Date
William Schwartz ec6d2531c5 Fixed #32314 -- Fixed detection when started non-django modules with "python -m" in autoreloader.
django.utils.autoreload.get_child_arguments() detected when Python was
started with the `-m` option only for `django` module. This commit
changes the logic to check __spec__, see
https://docs.python.org/3/reference/import.html#main-spec

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

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

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

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