Commit Graph

10194 Commits

Author SHA1 Message Date
Rob c231a75112 Fixed #30436 -- Added check that on_delete is callable in ForeignKey and OneToOneField. 2019-05-13 07:25:42 +02:00
Amir Hadi 330638b89f Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows.
Co-authored-by: Tim Graham <timograham@gmail.com>
Co-authored-by: Patryk Zawadzki <patrys@room-303.com>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-05-12 07:05:24 +02:00
Jon Dufresne 7c3732a1b4 Fixed #30470 -- Added assertHTMLEqual() support for all self closing tags.
Support for the following tags was added: area, embed, param, track, and
wbr.

The full list of self closing tags is documented at:

https://html.spec.whatwg.org/#void-elements
2019-05-10 12:04:07 +02:00
Jon Dufresne b7a33ee4f0 Fixed #30468 -- Fixed assertHTMLEqual() to handle all ASCII whitespace in a class attribute. 2019-05-09 17:18:18 +02:00
Jon Dufresne de6d3afb97 Refs #27804 -- Used subTest() in HTMLEqualTests.test_self_closing_tags. 2019-05-09 17:17:42 +02:00
luzpaz e2feea5fc4 Fixed comment typo. 2019-05-09 17:04:50 +02:00
Troon a3a4f5c144 Fixed #30310 -- Added support for looking up HttpHeaders.headers using underscores. 2019-05-09 16:26:52 +02:00
Jon Dufresne 48235ba807 Refs #30399 -- Made assertHTMLEqual normalize character and entity references. 2019-05-09 15:55:32 +02:00
Hasan Ramezani f038214d91 Fixed #29056 -- Fixed HTML5 validation of required SelectDateWidget.
placeholder is required for "select" with "required" attribute.
2019-05-08 12:46:30 +02:00
Mariusz Felisiak ef9f2eb69c
Refs #30462 -- Added test for conditional aggregation on annotated subquery. 2019-05-08 11:29:17 +02:00
Jon Dufresne b915b9f10f Refs #27753 -- Deprecated django.utils.text.unescape_entities().
The function was undocumented and only required for compatibility with
Python 2.

Code should use Python's html.unescape() that was added in Python 3.4.
2019-05-08 08:00:59 +02:00
Rob 6b736dd074 Fixed #30349 -- Fixed QuerySet.exclude() on FilteredRelation.
Using annotated FilteredRelations raised a FieldError when coupled with
exclude(). This is due to not passing filtered relation fields to the
subquery created in split_exclude(). We fixed this issue by passing the
filtered relation data to the newly created subquery.

Secondly, in the case where an INNER JOIN is used in the excluded
subquery, the ORM would trim the filtered relation INNER JOIN in attempt
to simplify the query. This will also remove the ON clause filters
generated by the FilteredRelation. We added logic to not trim the INNER
JOIN if it is from FilteredRelation.
2019-05-07 14:47:50 +02:00
Chris Adkins 705ef6cfeb Fixed #30447 -- Added 'is_in_european_union' in GeoIP2.city() dict. 2019-05-07 13:31:44 +02:00
Tobias Kunze 0e2ed4fdd1 Refs #26678 -- Added tests for using the field the relation points to with RelatedManager.add()/remove()/set(). 2019-05-07 09:02:06 +02:00
Tobias Kunze 3166880301 Fixed #29352 -- Allowed specifying a Feed language. 2019-05-06 15:10:54 +02:00
Stephen Brown 86a3ad351e Fixed #30339 -- Made Model.delete(keep_parents=True) preserves nested parent reverse relationships.
Thanks Simon Charette for the review.
2019-05-06 13:04:31 +02:00
Mariusz Felisiak 8c5649bfb7
Fixed NonQueryWindowTests.test_unsupported_backend() on MySQL. 2019-05-03 13:49:02 +02:00
Tobias Kunze e683613649 Fixed #20122 -- Made pluralize template filter return '' on invalid input. 2019-05-03 11:35:20 +02:00
Tobias Kunze a9b8898242 Refs #11929 -- Fixed ordering of test YAML dumps.
Thanks Nick Pope for the review.
2019-05-03 10:48:18 +02:00
Mariusz Felisiak 9006189c0e
Removed unused YamlSerializerTestCase.fwd_ref_str.
Unused since its introduction in febd5aeec6.
2019-05-03 10:00:06 +02:00
can 567b9928a3 Fixed #29692 -- Fixed removing ordering parts for multiline RawSQL expressions. 2019-05-03 07:37:37 +02:00
Mykola Kokalko ef082ebb84 Fixed #29529 -- Allowed models.fields.FilePathField to accept a callable path. 2019-05-02 11:11:56 +02:00
Mykola Kokalko 11971cd87c Added tests for setting models.fields.FilePathField.path. 2019-05-02 11:11:50 +02:00
can bceadd2788 Fixed #30396 -- Added system checks for uniqueness of indexes and constraints names.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-05-02 09:13:20 +02:00
zeyneloz 6485a5f450 Fixed #30409 -- Allowed using foreign key's attnames in unique/index_together and Index's fields. 2019-05-01 11:51:27 +02:00
François Freitag 568eed9e79 Fixed #30245 -- Added -k option to DiscoverRunner. 2019-04-30 16:20:51 +02:00
can 719b746620 Fixed #30412 -- Fixed crash when adding check constraints with OR'ed condition on Oracle and SQLite. 2019-04-30 12:32:27 +02:00
Jon Dufresne 6866c91b63 Fixed #30418 -- Added --skip-checks management command option. 2019-04-30 10:48:30 +02:00
Simon Charette a8b3f96f6a Fixed #30408 -- Fixed crash when adding check constraints with LIKE operator on Oracle and PostgreSQL.
The LIKE operator wildcard generated for contains, startswith, endswith and
their case-insensitive variant lookups was conflicting with parameter
interpolation on CREATE constraint statement execution.

Ideally we'd delegate parameters interpolation in DDL statements on backends
that support it but that would require backward incompatible changes to the
Index and Constraint SQL generating methods.

Thanks David Sanders for the report.
2019-04-30 07:38:22 +02:00
kingbuzzman 673fe2e3ec Fixed #30148 -- Logged COPY ... TO statements in connection.queries on PostgreSQL. 2019-04-29 14:20:17 +02:00
Tom Forbes 6754bffa2b Fixed #30323 -- Fixed detecting changes by autoreloader when using StatReloader. 2019-04-29 11:41:00 +02:00
Mariusz Felisiak ed880d92b5
Added tests for queries log in CursorDebugWrapper.executemany(). 2019-04-29 10:38:17 +02:00
Jon Dufresne 0dd2308cf6 Fixed Python PendingDeprecationWarning in select_for_update.tests. 2019-04-29 08:47:33 +02:00
Jon Dufresne 5627057f63 Refs #26022 -- Used context manager version of assertRaisesMessage in tests.
Follow up to 253adc2b8a.
2019-04-29 08:05:07 +02:00
Carlton Gibson 98296f86b3
Fixed #30351 -- Handled pre-existing permissions in proxy model permissions data migration.
Regression in 181fb60159.
2019-04-27 20:18:22 +02:00
Daniel Hahler 08a4ee0651 Fixed typos in test names. 2019-04-27 07:47:42 +02:00
Jacob Green ed3c59097a
Fixed #30361 -- Increased the default timeout of watchman client to 5 seconds and made it customizable.
Made the default timeout of watchman client customizable via
DJANGO_WATCHMAN_TIMEOUT environment variable.
2019-04-26 12:55:49 +02:00
Aarni Koskela efeceba589
Fixed #30312 -- Relaxed admin check from django.contrib.sessions to SessionMiddleware subclasses. 2019-04-26 11:31:06 +02:00
Jon Dufresne 8d76443aba Fixed #30399 -- Changed django.utils.html.escape()/urlize() to use html.escape()/unescape(). 2019-04-25 15:09:07 +02:00
Alasdair Nicol a5accc0368 Fixed #30318 -- Added check for importability of arguments of custom error handler views.
Thanks to Jon on Stack Overflow for reporting the issue.
2019-04-25 11:08:22 +02:00
oliver fc9566d42d Fixed #30393 -- Added validation of startapp's directory option. 2019-04-25 08:52:48 +02:00
Ville Skyttä 0f22671ecb Fixed #30388 -- Made inspectdb generate OneToOneFields rather than ForeignKey(unique/primary_key=True). 2019-04-25 08:09:32 +02:00
Jon Dufresne 0a01ca80d7 Refs #30241 -- Fixed BytesWarning emitted in test_translation tests. 2019-04-24 15:31:03 +02:00
Martijn Jacobs 9141da1a80 Fixed #30366 -- Skipped StatReloaderTests on HFS+ filesystems.
When on MacOS High Sierra or below (<=10.13) it could be that a HFS+
filesystem is used. HFS+ has a time resolution of only one second
which can be too low for some of the tests.
2019-04-24 15:28:20 +02:00
Jon Dufresne 8b3f1c35dd Removed unnecessary assignments in various code. 2019-04-24 13:09:29 +02:00
Matthias Kestenholz 80482e9249 Fixes #30342 -- Removed a system check for LANGUAGES_BIDI setting.
This partly reverts commit 4400d8296d.
2019-04-24 10:54:03 +02:00
Carlton Gibson 607ff4efa3 Refs #30254 -- Added tests for Model.__hash__() inheritance. 2019-04-24 09:59:09 +02:00
can c00b4dbda2 Fixed #29810 -- Fixed crash of select_related() on FilteredRelation with empty result. 2019-04-23 13:48:33 +02:00
Simon Charette 405c836336 Fixed #30385 -- Restored SearchVector(config) immutability.
Regression in 1a28dc3887.

The usage of CONCAT to allow SearchVector to deal with non-text fields
made the generated expression non-IMMUTABLE which prevents a functional
index to be created for it.

Using a combination of COALESCE and ::text makes sure the expression
preserves its immutability.

Refs #29582. Thanks Andrew Brown for the report, Nick Pope for the
review.
2019-04-23 08:11:33 +02:00
Mariusz Felisiak 12b7956fc3
Refs #25507 -- Added tests for using QuerySet.count() with a RawSQL annotation.
Fixed in 3f32154f40
2019-04-19 11:40:04 +02:00