Commit Graph

10740 Commits

Author SHA1 Message Date
Taoup 271fdab8b7 Fixed #31286 -- Made database specific fields checks databases aware.
Follow up to 0b83c8cc4d.
2020-02-24 14:23:46 +01:00
Mariusz Felisiak 94d4bd3a09
Fixed backends tests on Oracle.
Using Person in test_introspection caused removing constraints in
intermediate table for ManyToManyField in
VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ that were
expected by other transaction tests. A model without any constraints
was used to prevent isolation issues.
2020-02-24 14:21:50 +01:00
Diederik van der Boor 84e35f4679 Fixed #31292 -- Fixed django.contrib.gis.gdal.gdal_full_version() crash. 2020-02-24 13:28:51 +01:00
Diederik van der Boor 975eb42036 Added test for django.contrib.gis.gdal.gdal_version(). 2020-02-24 13:15:35 +01:00
Jon Dufresne f02c1fcf4c
Corrected typo in test docstring. 2020-02-20 09:12:09 +01:00
Jon Dufresne 94d1d4a71b Captured logging in DebugViewTests with assertLogs(). 2020-02-20 09:07:15 +01:00
Mariusz Felisiak 4261907ff3 Fixed tests when run in reverse.
Regression in 98f23a8af0.
2020-02-19 14:48:26 +01:00
Fabio Sangiovanni b457068cf2 Fixed #31187 -- Fixed detecting of existing total ordering in admin changelist when using Meta.constraints.
Detection of existing total ordering in admin changelist now takes into
account non-partial unique constraints.
2020-02-19 09:36:23 +01:00
Fabio Sangiovanni 73a34f3fa8 Removed duplicate tests in ChangeListTests.test_total_ordering_optimization(). 2020-02-19 07:43:50 +01:00
Yoo In Keun 4ef107e34f Fixed typos in docs and a test comment. 2020-02-19 07:08:23 +01:00
Claude Paroz 4d973f5939 Refs #26601 -- Deprecated passing None as get_response arg to middleware classes.
This is the new contract since middleware refactoring in Django 1.10.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-02-18 20:03:44 +01:00
Carlton Gibson a34cb5a6d4 Refs #31282 -- Clarified M2O add/remove/set with PK behaviour.
Improved error message for remove() and added tests.
2020-02-18 19:54:29 +01:00
Mariusz Felisiak 2a038521c4
Fixed #31271 -- Preserved ordering when unifying query parameters on Oracle.
This caused misplacing parameters in logged SQL queries.

Regression in 79065b55a7.

Thanks Hans Aarne Liblik for the report.
2020-02-18 11:45:12 +01:00
Taoup cbb6531e5b Fixed #31228 -- Reallowed aggregates to be used with multiple expressions and no DISTINCT on SQLite.
Regression in bc05547cd8.

Thanks Andy Terra for the report.
2020-02-18 10:32:23 +01:00
Keshav Kumar f37d548ede Fixed #20995 -- Added support for iterables of template names to {% include %} template tag.
Thanks Adam Johnson for the review.
2020-02-18 06:56:05 +01:00
Xavier Francisco 8690878507 Fixed #31277 -- Relaxed system check of m2m intermediary tables for db_table collision when database routers are installed.
Turned the error into a warning when database routers are installed.
2020-02-17 13:53:45 +01:00
Matthijs Kooijman 98f23a8af0 Fixed #26552 -- Deferred constraint checks when reloading the database with data for tests.
deserialize_db_from_string() loads the full serialized database
contents, which might contain forward references and cycles. That
caused IntegrityError because constraints were checked immediately.

Now, it loads data in a transaction with constraint checks deferred
until the end of the transaction.
2020-02-14 13:18:06 +01:00
Mariusz Felisiak b330b918e9
Removed unused and incorrect PossessedCar.__str__() method in test_utils.
PossessedCar doesn't have a color.
2020-02-14 13:16:17 +01:00
Claude Paroz cd2d508707 Removed redundant MiddlewareTest.test_old_style_request() test.
CurrentSiteMiddleware.process_request() is already covered by
MiddlewareTest.test_request().
2020-02-14 10:35:58 +01:00
Claude Paroz 6fba85b766 Removed unused cache.tests.CacheUtils._set_cache().
Unused since its introduction in 71a03e01aa.
2020-02-13 13:53:12 +01:00
yura 54b7af7eb4 Fixed #31250 -- Ignored processing instructions in assertXMLEqual()/assertXMLNotEqual(). 2020-02-13 11:03:54 +01:00
Dennis Schwertel 4070d6ceb0 Fixed #31267 -- Added tests cases with empty username or password for URLValidator.
Follow up to cdcf4164be.
2020-02-13 08:32:20 +01:00
Hasan Ramezani 49275c5488 Fixed #30261 -- Prevented Form._html_output() from mutating errors if hidden fields have errors. 2020-02-13 08:12:44 +01:00
Claude Paroz da4923ea87 Refs #27468 -- Made PasswordResetTokenGenerator use SHA-256 algorithm. 2020-02-12 21:46:56 +01:00
Claude Paroz 27f67317da Removed unnecessary token regex in auth_tests URLs.
All URLs in django.contrib.auth use a "<uidb64>/<token>" pattern.
2020-02-12 10:45:53 +01:00
Abhijeet Viswa 1712a76b9d Fixed #31246 -- Fixed locking models in QuerySet.select_for_update(of=()) for related fields and parent link fields with multi-table inheritance.
Partly regression in 0107e3d105.
2020-02-11 20:43:57 +01:00
Florian Apolloner 41a3b3d186 Fixed #31240 -- Properly closed FileResponse when wsgi.file_wrapper is used.
Thanks to Oskar Persson for the report.
2020-02-11 20:39:12 +01:00
Florian Apolloner 549445519c Reverted "Fixed #30565 -- Closed HttpResponse when wsgi.file_wrapper closes file-like object."
This reverts commit cce47ff65a.
2020-02-11 20:39:12 +01:00
Jon Dufresne e3f6e18513 Fixed #31253 -- Fixed data loss possibility when using caching from async code.
Case missed in a415ce70be.
2020-02-11 09:09:25 +01:00
=Pratik Kumar 20ba3ce4ac Fixed #30846 -- Made PostGIS backend respect Index's name argument. 2020-02-10 13:25:32 +01:00
Hannes Ljungberg adcf1a7308 Fixed #31248 -- Added missing space before USING SQL on PostGIS. 2020-02-10 11:20:45 +01:00
Adam Johnson 382af9b141 Fixed #31003 -- Doc'd and tested return value of QuerySet.bulk_create(). 2020-02-10 08:36:50 +01:00
Mariusz Felisiak 708c534e0b Refs #31055 -- Fixed Model.check() call in ConstraintsTests.test_check_constraints_required_db_features(). 2020-02-08 17:23:35 +01:00
Hasan Ramezani fc4f45ebdc Used assertRaisesMessage() in various tests. 2020-02-07 12:46:23 +01:00
Simon Charette 71756bdfed Fixed #31055 -- Made constraint checks support databases aware. 2020-02-07 11:03:53 +01:00
Simon Charette 0b83c8cc4d Refs #31055 -- Added --database option to the check management command.
This avoids enabling the ``database`` checks unless they are explicitly
requested and allows to disable on a per-alias basis which is required
when only creating a subset of the test databases.

This also removes unnecessary BaseCommand._run_checks() hook.
2020-02-07 11:01:31 +01:00
Jon Dufresne 3259983f56 Fixed #31233 -- Closed database connections and cursors after use. 2020-02-06 15:35:23 +01:00
Jon Dufresne f48f671223 Refs #31233 -- Changed DatabaseWrapper._nodb_connection to _nodb_cursor().
It is now a method instead of a property and returns a context manager
that yields a cursor on entry and closes the cursor and connection upon
exit.
2020-02-06 15:29:38 +01:00
Nikita Sobolev 2d55cb5c4a
Fixed typo in tests/model_inheritance/tests.py. 2020-02-06 14:20:02 +01:00
Jon Dufresne 2905b41670
Refs #31233 -- Added "error" filter for RuntimeWarning during tests. 2020-02-06 09:46:59 +01:00
adamb70 4c6ab1f2aa Fixed #28528 -- Allowed combining SearchVectors with different configs. 2020-02-06 07:52:50 +01:00
Adam Johnson 72b97a5b1e Fixed #31232 -- Changed default SECURE_REFERRER_POLICY to 'same-origin'. 2020-02-05 14:39:01 +01:00
Mariusz Felisiak 7fa1a93c6c
Refs #28214 -- Added test for escaping JSONField key lookups.
Thanks mrsanders for the report.

Fixed in 7deeabc7c7.
2020-02-05 14:31:30 +01:00
Hasan Ramezani da79ee472d Fixed #26813 -- Prevented empty choice in ModelChoiceField with RadioSelect for fields with blank=False. 2020-02-05 10:27:01 +01:00
Mariusz Felisiak 1d5fb35e6a Refs #26813 -- Added test for ModelChoiceField.choices when using RadioSelect widget. 2020-02-05 09:21:38 +01:00
Nick Pope 335c9c94ac Simplified imports from django.db and django.contrib.gis.db. 2020-02-04 13:20:06 +01:00
Claude Paroz 8ae84156d6 Fixed #27604 -- Used the cookie signer to sign message cookies.
Co-authored-by: Craig Anderson <craiga@craiga.id.au>
2020-02-04 08:05:02 +01:00
Simon Charette eb31d84532 Fixed CVE-2020-7471 -- Properly escaped StringAgg(delimiter) parameter. 2020-02-03 08:49:13 +01:00
Mariusz Felisiak 6b178a3e93
Fixed #31217 -- Made QuerySet.values()/values_list() group by not selected annotations with aggregations used in order_by().
Regression in 59b4e99dd0.

Thanks Jon Dufresne for the report and Simon Charette for the review.
2020-02-03 07:48:11 +01:00
Mariusz Felisiak a260001a2d
Refs #30943 -- Fixed postgres_tests on PostgreSQL 9.5.
Bloom extension is available on PostgreSQL 9.6+.
2020-01-31 20:42:16 +01:00