summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-07-07Fixed #32866 -- Fixed trimming trailing punctuation from escaped string in ↵Shipeng Feng
urlize().
2021-07-07Used more specific unittest assertions in tests.Mads Jensen
2021-07-06Added test for errors when saving timezone-aware times if not supported.abhiabhi94
2021-07-06Added more tests for parse_time().Keryn Knight
2021-07-06Fixed #32776 -- Added support for Array subqueries on PostgreSQL.Hannes Ljungberg
2021-07-05Fixed isolation of RouterTestCase.test_m2m_cross_database_protection().Mariusz Felisiak
Hardcoded pks are necessary for this test case, however we need to set them for all new rows because the sequence will not increment automatically. It works when the sequence is incremented by other test cases.
2021-07-05Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert".Mateo Radman
2021-07-05Fixed isolation of test_filename_traversal_upload().Mariusz Felisiak
shutil.rmtree(MEDIA_ROOT) is already called as a class cleanup.
2021-07-05Fixed #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL.Wu Haotian
2021-07-05Refs #28574 -- Added test for XML format output to Queryset.explain().Wu Haotian
2021-07-05Refs #24121 -- Added __repr__() to AdminSite, DefaultAdminSite, and ModelAdmin.Eduardo Aldair Ahumada Garcia Jurado
Thanks tlebrize for the initial patch.
2021-07-02Fixed #30934 -- Included database alias in django.db.backends log messages.Nick Pope
This is useful when working with database routing as you want to know where each query is being executed. Co-authored-by: David Winterbottom <david.winterbottom@gmail.com>
2021-07-02Fixed #28935 -- Fixed display of errors in extended blocks.cammil
Get the template that caused the exception and get the exception info from that template, using the node that caused the exception.
2021-07-02Refs #26430 -- Re-introduced empty aggregation optimization.Simon Charette
The introduction of the Expression.empty_aggregate_value interface allows the compilation stage to enable the EmptyResultSet optimization if all the aggregates expressions implement it. This also removes unnecessary RegrCount/Count.convert_value() methods. Disabling the empty result set aggregation optimization when it wasn't appropriate prevented None returned for a Count aggregation value. Thanks Nick Pope for the review.
2021-07-02Fixed #26430 -- Fixed coalesced aggregation of empty result sets.Simon Charette
Disable the EmptyResultSet optimization when performing aggregation as it might interfere with coalescence.
2021-07-01Fixed #32893 -- Fixed serialization of models.Model class in migrations.abhiabhi94
Migrations assumed that an import of the models.Model class must already be included when it's serialized, but for models with only custom fields this was not necessarily the case. Thanks Jaap Joris Vens for the report.
2021-07-01Fixed #32889 -- Allowed per-request sync_to_async context in ASGIHandler .Allan Feldman
By using a asgiref's ThreadSensitiveContext context manager, requests will be able to execute independently of other requests when sync work is involved. Prior to this commit, a single global thread was used to execute any sync work independent of the request from which that work was scheduled. This could result in contention for the global sync thread in the case of a slow sync function. Requests are now isolated to their own sync thread.
2021-07-01Refs #32144 -- Made makemessages remove temporary files on preprocessing error.Carlton Gibson
Co-authored-by: Anders Hovmöller <anders.hovmoller@dryft.se>
2021-07-01Fixed #32144 -- Made makemessages remove temporary files when locale path ↵Carlton Gibson
doesn't exist.
2021-06-30Fixed #32786 -- Moved subquery ordering clearing optimization to the _in lookup.Hannes Ljungberg
Co-Authored-By: Simon Charette <charette.s@gmail.com>
2021-06-30Refs #32885 -- Used _read_csrf_cookie()/_set_csrf_cookie() in more CSRF tests.Chris Jerdonek
2021-06-30Fixed #32885 -- Removed cookie-based token specific logic from ↵Chris Jerdonek
CsrfViewMiddlewareTestMixin.
2021-06-29Refs #32655 -- Improved error if iter_test_cases() is passed a string.Chris Jerdonek
2021-06-29Refs #26430 -- Added tests for PostgreSQL-specific aggregates on ↵Mariusz Felisiak
EmptyQuerySets and used subTest().
2021-06-29Refs #32843 -- Added CsrfViewMiddlewareTestMixin._get_csrf_cookie_request() ↵Chris Jerdonek
hook.
2021-06-29Refs #32843 -- Added method/cookie arguments to ↵Chris Jerdonek
CsrfViewMiddlewareTestMixin._get_request(). This also removes unnecessary test hooks.
2021-06-29Refs #32843 -- Moved _get_GET_csrf_cookie_request() to ↵Chris Jerdonek
CsrfViewMiddlewareTestMixin.
2021-06-29Fixed #32843 -- Ensured the CSRF tests' _get_GET_csrf_cookie_request() sets ↵Chris Jerdonek
the request method.
2021-06-29Fixed #32381 -- Made QuerySet.bulk_update() return the number of objects ↵abhiabhi94
updated. Co-authored-by: Diego Lima <diego.lima@lais.huol.ufrn.br>
2021-06-28Fixed #32807 -- Fixed JSONField crash when redisplaying None values.Dan Strokirk
Thanks to Alex Hill for the initial patch.
2021-06-28Removed unnecessary json.loads() call in test_json_agg_empty().Nick Pope
2021-06-28Ensured that empty result test for JSONBAgg executes a query.Nick Pope
Use of QuerySet.none() will cause the EmptyQuerySet aggregation optimisation to be used. Change the test to be implemented like the other tests for empty results in this file.
2021-06-28Corrected test method and variable names for JSONBAgg.Nick Pope
This is probably a hangover from when the aggregate function was originally called JSONAgg during development.
2021-06-28Refs #32800 -- Added CsrfViewMiddleware tests for all combinations of ↵Chris Jerdonek
masked/unmasked cookies and tokens.
2021-06-28Refs #32800 -- Made CsrfViewMiddlewareTestMixin._csrf_id_cookie and ↵Chris Jerdonek
_csrf_id_token different. This also renames CsrfViewMiddlewareTestMixin._csrf_id to _csrf_id_token.
2021-06-28Refs #32800 -- Eliminated the need for separate _get_POST_bare_secret() methods.Chris Jerdonek
2021-06-28Refs #32800 -- Added to csrf_tests/tests.py the unmasked version of the secret.Chris Jerdonek
This also adds tests that the secret is correct, and updates existing tests to use the value.
2021-06-25Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using ↵Mateo Radman
"assert" in various code.
2021-06-24Fixed ResourceWarning in ↵Mariusz Felisiak
test_client.tests.ClientTest.test_uploading_named_temp_file().
2021-06-24Fixed #32727 -- Allowed spaces before time zone offset in parse_datetime().Ben Wilber
2021-06-23Fixed #32817 -- Added the token source to CsrfViewMiddleware's bad token ↵Chris Jerdonek
error messages.
2021-06-23Refs #32817 -- Added tests for bad CSRF token provided via X-CSRFToken or ↵Chris Jerdonek
custom header.
2021-06-23Refs #32817 -- Added post_token/meta_token/token_header arguments to ↵Chris Jerdonek
_get_POST_csrf_cookie_request().
2021-06-23Refs #32817 -- Combined the bad-or-missing CSRF token tests.Chris Jerdonek
2021-06-23Fixed #32790 -- Ensured test Client handles redirects to domain indexes ↵tomhamiltonstubber
without a specified trailing slash.
2021-06-22Refs #24121 -- Added __repr__() to StreamingHttpResponse and subclasses.Nicolas Restrepo
2021-06-22Fixed #32863 -- Skipped system check for specifying type of auto-created ↵Hasan Ramezani
primary keys on models with invalid app_label. Regression in b5e12d490af3debca8c55ab3c1698189fdedbbdb. Thanks Iuri de Silvio for the report.
2021-06-22Refs #32338 -- Removed 'for ="..."' from RadioSelect's <label>.David Smith
This improves accessibility for screen reader users. Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2021-06-22Fixed #32870 -- Improved error message when URLconf is empty.Igor Fernandes
2021-06-22Refs #32858, Refs #32392 -- Restored using :: shortcut syntax in Cast() on ↵Mariusz Felisiak
PostgreSQL. This partly reverts commit fdfbc66331292def201c9344e3cd29fbcbcd076a unnecessary since b69b0c3fe871167a0ca01bb439508e335143801f.