Commit Graph

9838 Commits

Author SHA1 Message Date
Hasan Ramezani cf915cb513 Added a test for a lookup in Model.refresh_from_db(fields=[...]). 2018-11-15 11:38:47 -05:00
Ian Foote e1fc07c047 Fixed #17930 -- Allowed ORing (|) with sliced QuerySets. 2018-11-15 09:43:58 -05:00
Sarah Guermond cd40306854 Fixed #25884 -- Fixed migrate --run-syncdb when specifying an app label. 2018-11-14 18:22:59 -05:00
Hasan Ramezani 6d4e5feb79 Fixed #29835 -- Made RelatedFieldListFilter respect ModelAdmin.ordering. 2018-11-14 14:29:39 -05:00
Basil Dubyk 35a08b8541 Fixed #17210 -- Made NullBooleanSelect use unknown/true/false as query data. 2018-11-14 13:43:34 -05:00
Mariusz Felisiak ff8020ed49 Fixed #29788 -- Added support for Oracle Managed File (OMF) tablespaces. 2018-11-13 18:22:41 -05:00
Simon Charette db13bca60a Fixed #29641 -- Added support for unique constraints in Meta.constraints.
This constraint is similar to Meta.unique_together but also allows
specifying a name.

Co-authored-by: Ian Foote <python@ian.feete.org>
2018-11-13 17:57:27 -05:00
oliver d0af5de122 Moved duplicate author declarations to setUpTestData() in DeleteViewTests. 2018-11-13 17:27:24 -05:00
Simon Charette dba4a634ba Refs #29641 -- Refactored database schema constraint creation.
Added a test for constraint names in the database.

Updated SQLite introspection to use sqlparse to allow reading the
constraint name for table check and unique constraints.

Co-authored-by: Ian Foote <python@ian.feete.org>
2018-11-13 15:25:44 -05:00
Simon Charette 2f120ac517 Fixed #29945 -- Moved contrib.postgres uninstallation logic to the app config. 2018-11-12 11:15:48 -05:00
Hasan Ramezani c7cc7526d5 Completed test coverage of contrib.humanize.templatetags.humanize. 2018-11-10 19:09:37 -05:00
Florian Apolloner 934acf1126 Fixed keep-alive support in manage.py runserver.
Ticket #25619 changed the default protocol to HTTP/1.1 but did not
properly implement keep-alive. As a "fix" keep-alive was disabled in
ticket #28440 to prevent clients from hanging (they expect the server to
send more data if the connection is not closed and there is no content
length set).

The combination of those two fixes resulted in yet another problem:
HTTP/1.1 by default allows a client to assume that keep-alive is
supported unless the server disables it via 'Connection: close' -- see
RFC2616 8.1.2.1 for details on persistent connection negotiation. Now if
the client receives a response from Django without 'Connection: close'
and immediately sends a new request (on the same tcp connection) before
our server closes the tcp connection, it will error out at some point
because the connection does get closed a few milli seconds later.

This patch fixes the mentioned issues by always sending 'Connection:
close' if we cannot determine a content length. The code is inefficient
in the sense that it does not allow for persistent connections when
chunked responses are used, but that should not really cause any
problems (Django does not generate those) and it only affects the
development server anyways.

Refs #25619, #28440.
2018-11-10 13:54:45 +01:00
Tim Graham f82be9ebc7
Fixed #29934 -- Added sqlparse as a require dependency. 2018-11-09 19:09:36 -05:00
Matthias Kestenholz f9ff1df1da Fixed #29917 -- Stopped collecting ModelAdmin.actions from base ModelAdmins. 2018-11-09 18:52:30 -05:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) a7ef4a56e0 Fixed #29920 -- Added a test for smart_urlquote()'s UnicodeError branch. 2018-11-09 12:39:08 -05:00
oliver 9b110f0a84 Moved duplicate author declarations to setUpTestData() in UpdateViewTests. 2018-11-09 15:26:52 +01:00
Simon Charette 75dfa92a05 Fixed #29908 -- Fixed setting of foreign key after related set access if ForeignKey uses to_field.
Adjusted known related objects handling of target fields which relies on
from and to_fields and has the side effect of fixing a bug bug causing
N+1 queries when using reverse foreign objects.

Thanks Carsten Fuchs for the report.
2018-11-08 19:51:15 -05:00
oliver 0ce2ad9ca4 Used QuerySet.bulk_create() in a couple tests. 2018-11-06 19:32:40 -05:00
romgar b3b1d3d45f Fixed #25251 -- Made data migrations available in TransactionTestCase when using --keepdb.
Data loaded in migrations were restored at the beginning of each
TransactionTestCase and all the tables are truncated at the end of
these test cases. If there was a TransactionTestCase at the end of
the test suite, the migrated data weren't restored in the database
(especially unexpected when using --keepdb). Now data is restored
at the end of each TransactionTestCase.
2018-11-06 16:57:50 -05:00
Tom Forbes ecac6d7a2a Improved performance of runtests.py with os.scandir(). 2018-11-04 18:56:46 -05:00
Hasan Ramezani 6b7f1c2530 Increased test coverage of django.utils.http. 2018-11-03 11:13:28 -04:00
Tom Forbes d207ac1568 Fixed #29883 -- Added selenium hub support to runtests.py. 2018-11-03 09:56:14 -04:00
Jayantha Gumballi dfcdc8992f Fixed #29886 -- Fixed unaccent lookup when PostgreSQL's standard_conforming_strings option is off.
Thanks Tom McClure for the patch.
2018-11-01 11:14:34 -04:00
Tim Graham 98ef3829e9 Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory.
Regression in 632c4ffd9c.
2018-10-31 19:28:11 -04:00
Javier Matos Odut 3d4d0a25b2 Fixed #29901 -- Allowed overriding an autocomplete/raw_id_fields/radio_fields widget with ModelAdmin.get_formset(). 2018-10-31 10:16:17 -04:00
Junyoung df448bfd02 Fixed #29783 -- Added app label validation to showmigrations command. 2018-10-30 19:29:00 -04:00
Artur Juraszek 817c6cdf0e Capitalized SecurityMiddleware headers for consistency with other headers.
(No behavior change since HTTP headers are case insensitive.)
2018-10-30 18:30:51 -04:00
Hasan Ramezani c1c68d1ac0 Increased test coverage of django/views/generic/dates.py. 2018-10-30 14:27:48 -04:00
Jayden Kneller 916aecd29d Fixed #29866 -- Made DiscoverRunner do tests tear down if running checks or tests raises an exception. 2018-10-30 12:01:48 -04:00
Simon Charette 630f3d8b46
Refs #29868 -- Prevented name collisions between test constraints on Oracle. 2018-10-30 09:26:03 -04:00
Mads Jensen a906c98982 Fixed #29547 -- Added support for partial indexes.
Thanks to Ian Foote, Mariusz Felisiak, Simon Charettes, and
Markus Holtermann for comments and feedback.
2018-10-29 19:34:54 -04:00
Hasan Ramezani 4f8f1b2f24 Fixed #29903 -- Added error message for invalid WeekArchiveView week_format. 2018-10-29 14:22:42 -04:00
Simon Charette d8e03fdeb9 Fixed #29897 -- Fixed autodetector's swappable MTI dependency resolution.
Thanks Steven Ganz for the detailed report.
2018-10-29 11:24:30 -04:00
Simon Charette 95bda03f2d Fixed #29868 -- Retained database constraints on SQLite table rebuilds.
Refs #11964.

Thanks Scott Stevens for testing this upcoming feature and the report.
2018-10-29 10:33:41 +01:00
Tim Graham f77fc56c96
Fixed #29896 -- Fixed incorrect Model.save() cache relation clearing for foreign keys that use to_field.
Regression in ee49306176.
2018-10-28 22:54:02 -04:00
Hasan Ramezani 4c13b90702 Added test coverage for views.generic.dates.MonthMixin.get_month() KeyError branch. 2018-10-27 18:37:44 -04:00
Tim Graham f892781b95 Fixed #28606 -- Deprecated CachedStaticFilesStorage. 2018-10-27 11:58:29 -04:00
Hasan Ramezani 55b0b766fb Completed test coverage of views.defaults.bad_request(). 2018-10-25 20:03:58 -04:00
Mariusz Felisiak c6525bea9e Fixed #29534 -- Made dbshell use rlwrap on Oracle if available. 2018-10-25 19:39:42 -04:00
Sergey Fedoseev 9a88c6dd6a Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL.
Regression in e1253bc26f.
2018-10-25 19:37:41 -04:00
Sanyam Khurana 83c7096f2a Fixed #29869 -- Made UUIDField.to_python() convert integers. 2018-10-24 20:26:57 -04:00
Sanyam Khurana c86a3d80a2 Fixed #29721 -- Ensured migrations are applied and recorded atomically. 2018-10-24 19:29:11 -04:00
Simon Charette 32da3cfdf9 Refs #11964 -- Removed raw SQL from and cleaned up constraint operation tests. 2018-10-24 19:18:41 -04:00
Tom Forbes 8f90593e6f Removed obsolete and flaky GeoIP tests. 2018-10-23 20:46:49 -04:00
Hasan Ramezani 6a8b57df6a Completed test coverage of views.static.directory_name(). 2018-10-23 20:44:27 -04:00
Prabakaran Kumaresshan 10d82c85aa Fixed #29831 -- Added validation for makemigrations --name. 2018-10-23 10:05:24 -04:00
jannschu efc0f77f02 Fixed #29830 -- Fixed loss of custom utf-8 body encoding in mails. 2018-10-22 15:21:33 -04:00
buzzi 24cae0bedc Fixed #29860 -- Allowed BaseValidator to accept a callable limit_value. 2018-10-22 10:26:54 -04:00
Simon Charette 5e3463f6bc Fixed #27595 -- Made ForeignKey.get_col() follow target chains.
Previously, foreign relationships were followed only one level deep which
prevents foreign keys to foreign keys from being resolved appropriately.
This was causing issues such as improper database value conversion for
UUIDField on SQLite because the resolved expression's output field's
internal type wasn't correct. Added tests to make sure unlikely foreign
reference cycles don't cause recursion errors.

Refs #24343.

Thanks oyooyo for the report and Wayne Merry for the investigation.
2018-10-22 09:49:34 -04:00
Florian Apolloner c53af56613 Fixed #29847 -- Ensured proper ordering in queries.
Even though good databases tend to keep the result sorted by the/one
window expression and the planners are smart enough to not resort if not
required, it is not valid to rely on this.

MariaDB specifically did return whatever order it wanted, which is
completely okay. Now we sort towards the expected data for all databases.
2018-10-21 22:05:06 +02:00