Commit graph

7338 commits

Author SHA1 Message Date
Ben Kraft
dee5896b55 [1.9.x] Fixed #26122 -- Fixed copying a LazyObject
Shallow copying of `django.utils.functional.LazyObject` or its subclasses has
been broken in a couple of different ways in the past, most recently due to
35355a4.

Backport of 13023ba867 from master
2016-01-26 06:57:27 -05:00
Preston Timmons
218cc71073 [1.9.x] Fixed #25848 -- Set template origin on each node.
Prior to 55f12f8709, the template origin was available on each node via
`self.token.source[0]`. This behavior was removed when debug handling was
simplified, but 3rd-party debugging tools still depend on its presence.
This updates the Parser to set origin on individual nodes. This enables the
source template to be determined even when template extending or including is
used.

Backport of cfda1fa3f8 from master
2016-01-26 06:23:51 -05:00
Simon Charette
645fddcd4e [1.9.x] Refs #24919 -- Used the documented way of disabling migrations per app.
Backport of 477274acb4 from master
2016-01-25 22:02:51 -05:00
Simon Charette
abdbf00815 [1.9.x] Fixed #26135 -- Adjusted the migration questioner's handling of disabled apps.
This was causing an issue when calling the `migrate` command in a test case with
the `available_apps` attribute pointing to an application with migrations
disabled using the `MIGRATION_MODULES` setting.

Thanks to Tim Graham for the review.

Refs #24919

Backport of 4dcaa5871b from master
2016-01-25 22:02:45 -05:00
Chris Lamb
3306106fb1 [1.9.x] Fixed #25968 -- Changed project/app templates to use a "py-tpl" suffix.
Debian packages unconditionally byte-compile .py files on installation and
do not silence errors by design. Therefore, we need a way of shipping these
invalid .py files without a .py extension but ensuring that when we
template them, they end up as .py.

We don't special-case .py files so that the all the TemplateCommand
command-line options (eg. extra_files and extensions) still work entirely
as expected and it may even be useful for other formats too.

Backport of abc0777b63 from master
2016-01-25 12:44:14 -05:00
Mingun Pak
74db1378d5 [1.9.x] Fixed typos in test comments.
Backport of 4c912d184d from master
2016-01-23 12:46:14 -05:00
Tim Graham
1aee5e8582 [1.9.x] Fixed #26116 -- Corrected schema's test_alter_implicit_id_to_explicit.
AUTOINCREMENT is dropped converting an AutoField to IntegerField
which isn't the point of this test. MySQL would warn or error about
this.

Backport of b49cc86643 from master
2016-01-22 13:08:46 -05:00
Luke Plant
b5c4972283 [1.9.x] Changed action="." to action="" in tests and docs.
`action="."` strips query parameters from the URL which is not usually what
you want. Copy-paste coding of these examples could lead to difficult to
track down bugs or even data loss if the query parameter was meant to alter
the scope of a form's POST request.

Backport of 77974a684a from master
2016-01-21 14:00:06 -05:00
Alexander Gaevsky
be3169d6ed [1.9.x] Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.
Backport of 9a33d3d764 from master
2016-01-21 13:22:02 -05:00
Tim Graham
c9d1d5593b [1.9.x] Refs #26092 -- Added @skipUnlessDBFeature to a test.
Backport of fb4272f0e6 from master
2016-01-21 08:07:09 -05:00
Aymeric Augustin
cfe4ba6e90 [1.9.x] Fixed #26063 -- Crash when passing > 2000 params.
If SQLITE_MAX_VARIABLE_NUMBER (default = 999) is changed at compile time
to be greater than SQLITE_MAX_COLUMN (default = 2000), which Debian does
by setting the former to 250000, Django raised an exception on queries
containing more than 2000 parameters when DEBUG = True.

Backport of f91b5a7e4b from master
2016-01-21 10:48:47 +01:00
Anssi Kääriäinen
05e8fa83c3 [1.9.x] Fixed #26092 -- Fixed QuerySet.order_by() regression with an M2M through model.
Backport of ee596888e1 from master
2016-01-20 19:16:18 -05:00
chemary
076d459110 [1.9.x] Fixed #26094 -- Fixed CSRF behind a proxy (settings.USE_X_FORWARDED_PORT=True).
Backport of 2d28144c95 from master
2016-01-20 18:23:55 -05:00
Alberto Avila
16a52cff32 [1.9.x] Refs #26071 -- Added test for __in lookup in a Case expression.
Forwardport of 5b3c66d8b6 from stable/1.8.x
2016-01-13 08:53:01 -05:00
pp
1cbc556bce [1.9.x] Added missing period to "etc.".
Backport of b34ff66e5b from master
2016-01-11 18:05:56 -05:00
Simon Charette
27ef6403c8 [1.9.x] Fixed #25858 -- Bound abstract model application relative relationships.
Thanks to Karl Hobley for the report and Markus, Shai, Aymeric for their input
and Tim for the review.

Backport of bc7d201bdb from master
2016-01-11 14:08:50 -05:00
Alexander Gaevsky
cb96d0c92a [1.9.x] Added a test for adding a UUID pk object using the "Add related" admin popup.
Follow up to refs #25997 but this case wasn't broken.

Backport of 5052f79df4 from master
2016-01-08 18:54:40 -05:00
Tim Graham
3d324b9614 [1.9.x] Fixed #26034 -- Fixed incorrect index handling on PostgreSQL on Char/TextField with unique=True and db_index=True.
Thanks Simon Charette for review.

Backport of 56aaae58a7 from master
2016-01-08 14:20:53 -05:00
Tim Graham
20c8cc2bf5 [1.9.x] Added a helper function in schema tests.
Backport of 54d3ba8406 from master
2016-01-08 14:16:22 -05:00
Alexander Gaevsky
a839d71d85 [1.9.x] Fixed #25997 -- Removed redundant escaping in admin's edit related model popup. 2016-01-08 11:06:56 -05:00
Claude Paroz
fe6d5689f2 [1.9.x] Fixed #26046 -- Fixed a crash with translations and Django-unknown language code
Thanks Jens Lundstrom for the report and Tim Graham for the review.
Backport of 632a9f21bc from master.
2016-01-06 20:33:26 +01:00
Scott Pashley
a7b69c8657 [1.9.x] Fixed #26035 -- Prevented user-tools from appearing on admin logout page.
Backport of 7cc2efc2d6 from master
2016-01-06 13:52:25 -05:00
Tim Graham
2b17ac2469 [1.9.x] Skipped a dateformat test on Windows as needed.
Refs 1014ba026e

Backport of 2765adc8dc from master
2016-01-05 13:12:09 -05:00
Denis Cornehl
ee2835e69c [1.9.x] Fixed #26024 -- Fixed regression in ConditionalGetMiddleware ETag support.
Backport of 186b6c61bf from master
2016-01-05 09:41:13 -05:00
Tim Graham
775291d4c7 [1.9.x] Fixed #26009 -- Fixed contenttypes_tests isolation.
Backport of 2c6c873e3f from master
2016-01-04 11:48:50 -05:00
varunnaganathan
5770c2382a [1.9.x] Fixed #25316 -- Fixed a crash with order_by() and values() after annotate().
Backport of 3eba9638ee from master
2016-01-02 08:19:41 -05:00
Attila Tovt
151027beab [1.9.x] Fixed #26008 -- Added parallel argument to paired_tests and bisect_tests
Backport of 0db6367fe2 from master
2016-01-02 05:19:03 -05:00
Tim Graham
5855bee1d1 [1.9.x] Removed British/Austrialian word: whilist.
Backport of 98839e9066 from master
2015-12-31 14:31:59 -05:00
Tim Graham
313d54bd3c [1.9.x] Made cosmetic cleanups in middleware tests.
Backport of 89616f0c79 from master
2015-12-31 10:30:12 -05:00
Anssi Kääriäinen
99569b22d9 [1.9.x] Fixed #23372 -- Made loaddata faster if it doesn't find any fixtures.
Django's test suite often tries to load fixture files from apps that have
no fixtures at all. This creates a lot of unnecessary disabling and
enabling of constraints which can be expensive on some database.

To speed this up, loaddata now first checks if any fixture file matches.
If no fixture file is matched, then the command exits before disabling
and enabling of constraints is done.

The main benefit of this change is seen on MSSQL, where tests on
Django 1.8 run hours faster.

Backport of ee9f4686b1 from master
2015-12-31 09:05:20 -05:00
Chris Cogdon
8202ce45a5 [1.9.x] Fixed #26018 -- Prevented unecessary get_form() call in FormMixin.get_context_data().
Changed "dict.setdefault" to "if x in dict" pattern so that get_form() would not
be called unnecessarily, specifically in the case where FormMixin.form_invalid()
calls get_context_data() with the current form.

Backport of e429c5186c from master
2015-12-30 17:30:37 -05:00
Chris Cogdon
4d9b98616f [1.9.x] Fixed #26006 -- Fixed incorrect object reference in SingleObjectMixin.get_context_object_name().
Backport of 4b2dcfe04f from master
2015-12-30 09:58:05 -05:00
Alexander Gaevsky
312e488a21 [1.9.x] Fixed #25465 -- Restored line breaks conversion in admin readonly fields.
Backport of 69208a5a1c from master
2015-12-29 19:37:29 -05:00
knbk
5f3c5e40b2 [1.9.x] Fixed typo in test name.
Backport of 300de968d6 from master
2015-12-29 12:48:53 -05:00
Tim Graham
2939ed4a18 [1.9.x] Fixed #23285 -- Fixed non-deterministic admin_views test.
This test sometimes fail because the checked integers can appear in the
output as memory addresses due to #24316.
2015-12-28 17:49:45 -05:00
Tim Graham
15af2e806b [1.9.x] Removed an unused import. 2015-12-28 17:46:33 -05:00
Varun Sharma
dc1ef0ff2e [1.9.x] Fixed #25984 -- Corrected RuntimeError message in ModelBase.__new__().
Backport of 692d055890 from master
2015-12-24 16:45:38 -05:00
Luis San Pablo
4f2eb5fc5d [1.9.x] Fixed #25981 -- Added need to update migrations to on_delete deprecation warning.
Backport of a856555df2 from master
2015-12-24 08:08:51 -05:00
Tomo Otsuka
bc5eed8fb0 [1.9.x] Fixed #25972 -- Restored support for the isnull lookup with ForeignObject.
Backport of 8b6974a685 from master
2015-12-24 07:35:08 -05:00
Tim Graham
dac48234d3 [1.9.x] Fixed #25729 -- Fixed flaky admin_widgets selenium test: test_ForeignKey_using_to_field
Backport of 5081adcb90 from master
2015-12-23 14:02:07 -05:00
Tim Graham
2f205e073b [1.9.x] Refs #25969 -- Replaced usage of render_to_response() with render() in tests.
Backport of edf3b88f1a from master
2015-12-23 10:23:41 -05:00
Tim Graham
c80d85d4ad [1.9.x] Fixed #25903 -- Fixed the admin's list_editable add/change buttons.
Backport of f18b08748a from master
2015-12-21 09:30:39 -05:00
Tim Graham
a80fb8ae24 [1.9.x] Fixed #25922 -- Fixed migrate --fake-initial detection of many-to-many tables.
Backport of fa9ce4e9a6 from master
2015-12-19 13:50:06 -05:00
Claude Paroz
f0a4ff2b11 [1.9.x] Fixed #25915 -- Allowed language not in Django's default LANGUAGES
This fixes a regression introduced by a5f6cbce07.
Thanks Gavin Wahl for the report and Tim Graham for the review.
Backport of cd3c042b0 from master.
2015-12-18 17:51:52 +01:00
Claude Paroz
ff077cd649 [1.9.x] Fixed #25942 -- Fixed TypedChoiceField.has_changed with nullable field
This fixes a regression introduced by 871440361.
Backport of d91cc25a2a from master.
2015-12-17 15:39:34 +01:00
Simon Charette
c4c72ade6f [1.9.x] Fixed #25852 -- Made sure AlterModelManager forces a reload of its model state.
Thanks to Geoffrey Sechter and the Django NYC group for the report and Markus
for the review.

Backport of c4e372aaf4 from master
2015-12-15 14:53:45 -05:00
Sergey Fedoseev
192d1eb5c3 [1.9.x] Fixed #25894 -- Fixed evaluation of zero-length slices of QuerySet.values().
Backport of 69b69f6d60 from master
2015-12-15 07:30:30 -05:00
Simon Charette
c402db2e2f [1.9.x] Fixed #25882 -- Prevented fast deletes matching no rows from crashing on MySQL.
Thanks to Trac aliases gerricom for the report, raphaelmerx for the
attempts to reproduce and Sergey Fedoseev and Tim for the review.

Refs #16891

Backport of 8035cee922 from master
2015-12-14 13:13:47 -05:00
Tim Graham
3c69d52377 [1.9.x] Fixed #25909 -- Added unicode_literals import to apps.py generated by startapp.
Backport of 10427646b8 from master
2015-12-12 09:50:17 -05:00
Sergey Fedoseev
515f149e4d [1.9.x] Fixed #25883 -- Fixed admin deletion page summary counts for related objects.
Backport of 8ab58b8052 from master
2015-12-10 18:11:45 -05:00