Commit Graph

9813 Commits

Author SHA1 Message Date
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
Florian Apolloner e127ef62de Fixed a failing test when the source directory is on a readonly fs. 2018-10-21 19:37:58 +02:00
Mariusz Felisiak 328f5627dd
Fixed #29870 -- Added DurationField introspection for Oracle and PostgreSQL.
Thanks Tim Graham for the review.
2018-10-21 09:08:05 +02:00
aspalding dc5e75d419 Fixed #29838 -- Fixed crash when combining Q objects with __in lookups and lists.
Regression in fc6528b25a.
2018-10-17 11:34:49 -04:00
aspalding 217f82d713 Refs #29838 -- Fixed make_hashable() for values that have lists or dicts nested in tuples.
And for non-hashable values that are iterable, e.g. sets.
2018-10-17 11:17:50 -04:00
aspalding 834c4ec8e4 Moved make_hashable() to django.utils and added tests. 2018-10-17 11:17:23 -04:00
Florian Apolloner bc7dd8490b Fixed #21171 -- Avoided starting a transaction when a single (or atomic queries) are executed.
Checked the following locations:

 * Model.save(): If there are parents involved, take the safe way and use
   transactions since this should be an all or nothing operation.

   If the model has no parents:

    * Signals are executed before and after the previous existing
      transaction -- they were never been part of the transaction.

    * if `force_insert` is set then only one query is executed -> atomic
      by definition and no transaction needed.

    * same applies to `force_update`.

    * If a primary key is set and no `force_*` is set Django will try an
      UPDATE and if that returns zero rows it tries an INSERT. The first
      case is completly save (single query). In the second case a
      transaction should not produce different results since the update
      query is basically a no-op then (might miss something though).

 * QuerySet.update(): no signals issued, single query -> no transaction
   needed.

 * Model/Collector.delete(): This one is fun due to the fact that is
   does many things at once.

   Most importantly though: It does send signals as part of the
   transaction, so for maximum backwards compatibility we need to be
   conservative.

   To ensure maximum compatibility the transaction here is removed only
   if the following holds true:

     * A single instance is being deleted.
     * There are no signal handlers attached to that instance.
     * There are no deletions/updates to cascade.
     * There are no parents which also need deletion.
2018-10-17 12:19:02 +02:00
Mads Jensen 1c0bf95ff6 Refs #23919 -- Removed a stray object-inheritance.
Follow up to 081e787160.
2018-10-16 09:58:53 -04:00
Jon Dufresne 0cd465b63a Fixed #29817 -- Deprecated settings.FILE_CHARSET. 2018-10-15 17:15:41 -04:00
Jon Dufresne 99d4fc18bd Refs #27829 -- Added warning for settings.DEFAULT_CONTENT_TYPE usage outside of Django. 2018-10-15 16:31:39 -04:00
oliver 1299421cad Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on a many-to-many relation. 2018-10-15 11:01:57 -04:00
Mariusz Felisiak f2e2a1bd4b
Fixed #29845 -- Fixed Cast crash on MySQL when casting to DecimalField. 2018-10-15 15:57:22 +02:00
Tim Graham 70a80ff1be Added a urlize test for wrapping characters. 2018-10-12 08:13:52 +02:00
Patrik Sletmo adfdb9f169 Fixed #29814 -- Added support for NoneType serialization in migrations. 2018-10-11 09:02:14 -04:00
Mariusz Felisiak 52fec5d18f
Fixed #29836 -- Bumped required cx_Oracle to 6.0. 2018-10-11 11:43:16 +02:00
Jon Dufresne c82893cb8c Refs #27795 -- Removed force_bytes() usage from django/utils/http.py.
django.utils.http.urlsafe_base64_encode() now returns a string, not a
bytestring. Since URLs are represented as strings,
urlsafe_base64_encode() should return a string. All uses immediately
decoded the bytestring to a string anyway.

As the inverse operation, urlsafe_base64_decode() accepts a string.
2018-10-10 14:38:22 -04:00
Hasan Ramezani b5d7604cb0 Completed FixedOffset test coverage. 2018-10-09 20:32:08 -04:00
Jon Dufresne e90af8bad4 Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
Jon Dufresne 31c0348687 Fixed postgres_tests.test_signals.OIDTests when run in isolation. 2018-10-09 09:23:36 -04:00
Eric Brandwein b0b4aac555 Fixed #29775 -- Fixed URL converters in a nested namespaced path.
When using include() without namespaces of some urlpatterns that
have an include() with namespace, the converters of the parent
include() weren't being used to convert the arguments of reverse().
2018-10-04 11:42:27 -04:00
Jon Dufresne 5a23a285de Used skip(If|Unless)DBFeature in transactions tests. 2018-10-04 10:09:06 -04:00
Jon Dufresne 9f6d0c11eb Removed Jinja2 dependency from admin_checks tests. 2018-10-04 16:05:22 +02:00
Jon Dufresne 9b508bdb9b Removed unnecessary skipUnless in HTTPSitemapTests.
contrib.sites is included in INSTALLED_APPS by SitemapTestsBase.
2018-10-04 08:50:18 -04:00
Jon Dufresne bdae19cf63 Refs #27795 -- Removed force_bytes() usage in sessions.
SessionBase.decode() is the inverse operation to SessionBase.encode().
As SessionBase.encode() always returns a string, SessionBase.decode()
should always be passed a string argument. Fixed the file backend, which
was the only backend still passing a bytestring.
2018-10-03 11:11:42 +02:00
Stefano Chiodino 6de7f9ec60 Fixed #29598 -- Deprecated FloatRangeField in favor of DecimalRangeField. 2018-10-02 19:17:23 -04:00
Simon Charette bc7e288ca9 Fixed #29745 -- Based Expression equality on detailed initialization signature.
The old implementation considered objects initialized with an equivalent
signature different if some arguments were provided positionally instead of
as keyword arguments.

Refs #11964, #26167.
2018-10-02 19:15:20 -04:00