Commit Graph

4449 Commits

Author SHA1 Message Date
Anssi Kääriäinen 2b1101a4a6 [1.6.x] Fixed #20820 -- Model inheritance + m2m fixture loading regression
Tests by Tim Graham, report from jeroen.pulles@redslider.net.

Backport of 1ed77e7782 from master
2013-08-20 17:15:52 +03:00
Simon Charette 3ae585b449 [1.6.x] Fixed a test failure introduced in f0bc2865ff.
`classobj` objects cannot be weakly referenced on Python 2.6
2013-08-20 04:08:41 -04:00
Simon Charette f0bc2865ff Fixed #20943 -- Weakly reference senders when caching their associated receivers
Backport of e55ca60903 from master.
2013-08-20 02:12:50 -04:00
Tim Graham c769c26601 [1.6.x] Revert "Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes"
This reverts commit 2b48fcc607.

It introduced a regression (#20777) which we can't easily fix in 1.6.
2013-08-16 07:59:16 -04:00
Alasdair Nicol 919934602f [1.6.x] Fixed #20895 -- Made check management command warn if a BooleanField does not have a default value
Thanks to Collin Anderson for the suggestion and Tim Graham for
reviewing the patch.

Backport of 22c6497f99 from master
2013-08-15 20:33:02 -04:00
Tim Graham ccff25b143 [1.6.x] Fixed #17778 -- Prevented class attributes on context from resolving as template variables.
Thanks KyleMac for the report, regebro for the patch, and Aymeric for the test.

Backport of 71b5617c24 from master.
2013-08-15 10:22:56 -04:00
Florian Apolloner b720ece065 [1.6.x] Removed unneeded conditional_escapes from the testsuite.
Backport of 4e50e40654 from master.
2013-08-13 22:24:14 +02:00
Jacob Kaplan-Moss bfbae15c66 Apply autoescaping to AdminURLFieldWidget.
This is a security fix; disclosure to follow shortly.
2013-08-13 11:06:00 -05:00
Collin Anderson e3e0cf8a0f [1.6.x] Fixed #20865 -- Fixed raw_id_fields to work with callable limit_choices_to.
Backport of d53e574676 from master
2013-08-06 13:44:31 -04:00
Alex Cucu 80b95a2b1f [1.6.x] Fixed #19918 -- Modified select_for_update to run on the write database.
Backport of 1c64a0f29e from master
2013-08-06 10:58:32 -04:00
Anssi Kääriäinen 363b81c59c [1.6.x] Fixed ordering related test failure
Also PEP8 + python_2_unicode_compatible cleanup done.

Backport of 263b873599 from master
2013-08-06 10:34:42 +03:00
Tim Heap 891cdf120a [1.6.x] Fixed #20850 -- Added MultiWidget.needs_multipart_form
Backport of 75c87e2d38 from master
2013-08-05 10:13:48 -04:00
Aymeric Augustin 2eac989985 [1.6.x] Fixed #20822 -- Set content type of default error pages to 'text/html'.
Thanks Jimmy Song for the patch.

Backport of 7843775 from master.
2013-08-04 11:04:58 +02:00
Petr Dlouhý 4e7745cc1c [1.6.x] Fixed LogEntry.get_admin_url() for non-existent models.
Regression introduced by [369b6fa]; refs #18169.

Backport of 1b47508ac8 from master
2013-08-02 12:51:46 -04:00
Loic Bistuer 4f8fb19994 [1.6.x] Fixed #18681 -- GenericInlineModelAdmin.get_formset() no longer bypasses get_fieldsets().
Refs 23e1b59 which already fixed this issue for ModelAdmin and InlineModelAdmin.

Backport of a0ed2f9260 from master
2013-08-02 10:45:58 -04:00
Aleksandra Sendecka 6e4fd816c4 [1.6.x] Fixed #18777 -- Localized form fields with as_text/as_hidden
Thanks croldan for the report.

Backport of 893d8de6f5 from master
2013-08-02 08:43:19 -04:00
Tim Graham 196cc875b2 [1.6.x] Fixed #17519 -- Fixed missing SQL constraints to proxy models.
Thanks thibaultj for the report, jenh for the patch,
and charettes for the tests.

Backport of aa830009de from master
2013-08-02 08:42:19 -04:00
Baptiste Mispelon badca4716f [1.6.x] Fixed #10491 -- Allowed passing lazy objects to HttpResponseRedirect.
Thanks liangent for the report.

Backport of 3c45fb8589 from master
2013-07-30 13:40:18 -04:00
Florian Apolloner 081a27c358 [1.6.x] Simplified smart_urlquote and added some basic tests.
Backport of b70c371fc1 from master.
2013-07-28 10:07:01 +02:00
Tim Graham dbbd2b1272 [1.6.x] Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.
Thanks CollinAnderson for the report.

Backport of 8676318d2d from master
2013-07-26 14:47:58 -04:00
Tim Graham 5cc1ea4773 [1.6.x] Updated contrib.admin to use Email/URLInputs; refs #16630
Backport of 2a979d2a7b from master
2013-07-26 08:02:10 -04:00
Anssi Kääriäinen 7f892cedba [1.6.x] Fixed related model lookup regression
It has been possible to use models of wrong type in related field
lookups. For example pigs__in=[a_duck] has worked. Changes to
ForeignObject broke that.

It might be a good idea to restrict the model types usable in lookups.
This should be done intentionally, not accidentally and without any
consideration for deprecation path.

Backpatch of 7cca8d56d2 from master.
2013-07-26 13:17:50 +03:00
Anssi Kääriäinen d439f85bbf [1.6.x] Fixed ._meta.pk_index() virtual field failure
Backport of 92476e880c from master
2013-07-25 16:35:04 +03:00
Claude Paroz 816bf0c6a7 [1.6.x] Fixed #20781 -- Fixed _has_changed regression with MultiValueField
Thanks Tim Graham for the report.
Backport of 02b0106d from master.
2013-07-22 09:07:04 +02:00
Claude Paroz 48516d3b85 [1.6.x] Fixed an email validation regression
Thanks Vincent Wagelaar for the report.
Backport of 11b7b9ad from master.
2013-07-21 21:12:50 +02:00
Karen Tracey 706e542eb5 [1.6.x] Fixed #13696 -- ensured inline pk field is rendered
Backport of 3aad955ea8 from master.
2013-07-21 13:13:20 -04:00
Simon Charette 9d3f7a21a3 [1.6.x] Fixed #20765 -- Set small values of `step` using exponential notation.
Browsers parse small factors of 10 as 0 under decimal notation.

Thanks to Trac alias matklad for the report and Claude Paroz for the review.

Backport of 415a36947c from master.
2013-07-19 23:45:29 -04:00
Loic Bistuer c660f0e985 [1.6.x] Fixed #20767 -- Fixed ModelAdmin.preserve_filters for namespaced URLs.
Thanks Collin Anderson for the report.

Backport of 2fc6c9472c from master.
2013-07-18 18:23:21 -04:00
Tim Graham e5241902f3 [1.6.x] Fixed #20681 -- Prevented teardown_databases from attempting to tear down aliases
Thanks simonpercivall.

Backport of d9c580306c from master
2013-07-13 17:46:37 -04:00
Tim Graham 26b88e7658 [1.6.x] Fixed a deprecation warning in a selenium test.
Backport of 9b471a8fe3 from master
2013-07-13 13:22:00 -04:00
Tim Graham 45fab74561 [1.6.x] Fixed #20740 -- GenericIPAddressField should pass protocol to formfield()
Thanks Jeff250.

Backport of f2cb94f1c0 from master
2013-07-12 16:06:43 -04:00
Tim Graham aecbaaed0c [1.6.x] Fixed #19196 -- Added test/requirements
Backport of 4d92a0bd86 from master.
2013-07-10 09:37:15 -04:00
Aymeric Augustin a2b4af3a1a Fixed #20724 -- Test failure on SQLite.
This test failure happened if the connection's NAME was set to a file
system path, and its TEST_NAME wasn't.

Thanks Claude for the report.

Conflicts:
	tests/transactions_regress/tests.py

Backport of 404870ee1f from master.
2013-07-09 21:43:20 +02:00
Aymeric Augustin d200405471 Avoided transaction.set_autocommit in tests.
It doesn't work as one might expect on a certain database backend where
autocommits_when_autocommit_is_off = True. That backend happens to be
popular for running tests.

Backport of 38bc581bc0 from master.
2013-07-09 21:42:11 +02:00
Tim Graham d14db25fee [1.6.x] Fixed #19940 -- Made test.runner.setup_databases properly handle aliases for default db.
Thanks simonpercivall.

Backport of 2cbd579efe from master.
2013-07-04 20:15:27 -04:00
Tim Graham 4c1029971e [1.6.x] Fixed a couple form/formset deprecation warnings in tests.
Backport of a521d10322 from master.
2013-07-01 09:38:29 -04:00
Tim Graham 3c51962cab [1.6.x] Updated tests for deprecation of Option.get_(add|change|delete)_permission.
refs #20642.

Backport of a6a905c619 from master.
2013-07-01 09:21:07 -04:00
Aymeric Augustin d255004289 [1.6.x] Stopped calling loaddata with commit=False.
This was a stealth option only used by the tests, and it isn't useful
any more since `atomic` provides nested transactions.

Backport of 2c40681 from master.
2013-06-30 14:20:29 +02:00
Claude Paroz 59be2c6875 [1.6.x] Fixed #18592 -- Prevented crash when accessing MySQL _last_executed
Thanks reames at asymmetricventures.com for the report.
Backport of 59b0c48ce from master.
2013-06-29 18:48:05 +02:00
Claude Paroz a9b5a1e506 [1.6.x] Do not allow FileSystemStorage.delete to receive an empty name
Refs #20660.
Backport of 7fbab3eba from master.
2013-06-29 18:12:23 +02:00
Claude Paroz b6aed803b2 [1.6.x] Fixed #20660 -- Do not try to delete an unset FieldFile
Thanks stanislas.guerra at gmail.com for the report and
Baptiste Mispelon for the review.
Backport of ea3fe78a9d from master.
2013-06-29 18:11:51 +02:00
Shai Berger d097417025 Support 'pyformat' style parameters in raw queries, Refs #10070
Add support for Oracle, fix an issue with the repr of RawQuerySet,
add tests and documentations. Also added a 'supports_paramstyle_pyformat'
database feature, True by default, False for SQLite.

Thanks Donald Stufft for review of documentation.
2013-06-28 06:59:10 +03:00
Tim Graham 7c0b72a826 Prevented running some admin_view tests twice. 2013-06-27 20:13:42 -04:00
Tim Graham 534ced5aad Fixed #20664 -- Fixed a bug with raw_id_fields on Python 3.
Thanks jefftriplett for the report.
2013-06-27 19:39:20 -04:00
Aymeric Augustin c1284c3d3c Fixed #20571 -- Added an API to control connection.needs_rollback.
This is useful:
- to force a rollback on the exit of an atomic block without having to
  raise and catch an exception;
- to prevent a rollback after handling an exception manually.
2013-06-27 22:19:54 +02:00
Andrew Godwin 99b467f272 Add related_query_name to ForeignKey/M2M. Refs #20244 2013-06-27 14:44:21 +01:00
Loic Bistuer a9ea7d8c70 Fixed #20462 - Replaced the str() cast introduced in 273dc55 by force_text() 2013-06-26 21:30:58 +07:00
Andrew Clark 273dc550a4 Fixed #20462 -- null/non-string regex lookups are now consistent
Thanks to noirbizarre for the report and initial patch.
2013-06-26 08:13:26 -04:00
Baptiste Mispelon ec371ace00 Fixed #20650 -- Fixed {% filter %} incorrectly accepting 'escape' as argument
Thanks to grzesiof for the report and to loic84 and Alex Gaynor
for the review.
2013-06-25 20:28:35 +02:00
Javier Mansilla f819bef3dc Fixed #19773 - Added admin/popup_response.html template.
Thanks jimmylam@ for the suggestion.
2013-06-25 11:20:41 -04:00
Russell Keith-Magee 0346563939 Fixed #20653 -- Renamed checksetup management command.
This is to allow future compatibility with work that is ongoing in the 2013 GSoC.
2013-06-25 09:37:54 +08:00
Ramiro Morales 1559f84d8b Fixed #20311 -- Make sure makemessages doesn't create duplicate Plural-Forms .po file headers.
Thanks naktinis for the report and initial patch.
2013-06-22 18:45:41 -03:00
Gilberto Gonçalves 680b512fc1 Fixed #20587 -- Made convert_values handle None values 2013-06-22 14:05:12 +01:00
Gilberto Gonçalves ef37b23050 Fixed #18872 -- Added prefix to FormMixin
Thanks @ibustama for the initial patch and dragonsnaker for opening the
report.
2013-06-22 12:12:43 +01:00
Claude Paroz ef79582e86 Fixed 17478 -- Allowed queryset overriding in BaseModelFormSet init
BaseModelFormSet.forms is now a cached property instead of being
populated in the __init__ method. This behaviour also matches an
example in the documentation.
Thanks Thomasz Swiderski for the report and Simon Charette for the
review.
2013-06-22 09:29:37 +02:00
Oliver Beattie 552a90b444 Fixed #20290 -- Allow override_settings to be nested
Refactored override_settings to store the underlying settings._wrapped
value seen at runtime, not instantiation time.
2013-06-21 16:57:47 +02:00
Simon Charette 04628e2016 Fixed #20630 -- Removed `maxlength` attribute from `NumberInput`.
This attribute is only allowed on inputs of type "text", "search", "url",
"tel", "email", or "password".

Thanks to yoyoma for the report and @bmispelon for the review.
2013-06-20 10:59:41 -04:00
Russell Keith-Magee 18e79f1425 Fixed #20486 -- Ensure that file_move_safe raises an error if the destination already exists.
Thanks to kux for the report, and Russ Webber for the patch.
2013-06-20 18:55:27 +08:00
Aymeric Augustin d9a43545be Merge pull request #1282 from loic/ticket6903
Fixed failing test on MySQL since c86a9b6
2013-06-19 03:04:04 -07:00
Loic Bistuer 7d0c3b9b26 Fixed MySQL failing test introduced by c86a9b6 2013-06-19 16:13:43 +07:00
Florian Hahn 2f35c6f10f Fixed #14930 -- values_list() failure on qs ordered by extra column
Thanks lsaffre for the report and simon29, vicould, and Florian Hahn
for the patch.

Some changes done by committer.
2013-06-18 23:56:51 +03:00
Aymeric Augustin 9da9b3eb04 Merge pull request #1281 from loic/ticket6903
Fixed #6903 - Preserved admin changelist filters.
2013-06-18 13:07:28 -07:00
Loic Bistuer c86a9b6398 Fixed #6903 - Preserve admin changelist filters after saving or deleting an object 2013-06-19 02:41:36 +07:00
Erik Romijn aeb1389442 Fixed #20079 -- Improve security of password reset tokens 2013-06-18 20:02:00 +02:00
Baptiste Mispelon 3128f3d38d Fixed #20618 -- Fixed regression in `BoundField.label_tag`. 2013-06-18 17:49:53 +02:00
Loic Bistuer ee77d4b253 Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
Loic Bistuer f34cfec0fa Refactored ValidationError to allow persisting error params and error codes as the exception bubbles up 2013-06-18 08:01:17 -04:00
Baptiste Mispelon 1b7634a0d0 Fixed #20464 -- Added a `total_error_count` method on formsets.
Thanks to frog32 for the report and to Tim Graham for the review.
2013-06-16 15:49:30 -04:00
Aymeric Augustin c3df866619 Fixed #20603 -- Made the test suite faster.
By avoiding to run syncdb with the full set of test models.

Thanks Anssi for the idea.
2013-06-14 23:16:15 +02:00
Marc Tamlyn 46789e76c6 Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suite 2013-06-14 15:37:39 +01:00
Anssi Kääriäinen 5459795ef2 Fixed #20289 -- pickling of dynamic models 2013-06-14 17:05:54 +03:00
Anssi Kääriäinen 855d1305c5 Added cache to available_apps in cache tests 2013-06-14 17:05:54 +03:00
Anssi Kääriäinen 89bf7a4525 Fixed #20528 -- regression in select_related join promotion
The join used by select_related was incorrectly INNER when the query
had an ORed filter for nullable join that was trimmed away. Fixed this
by forcing the join type to LOUTER even when a join was trimmed away
in ORed queries.
2013-06-14 16:29:06 +03:00
Marc Tamlyn b7bd7087e6 Fixed #15273 -- Extend RedirectView to allow reversal by name.
Thanks to @DrMeers for the report and @ludwigkraatz for the initial patch.
2013-06-14 11:59:26 +01:00
Wilfred Hughes 8365ed08b8 Fixed #17076 -- When reversing a URL fails, inform the user which patterns were tried. 2013-06-14 10:26:30 +01:00
Daniel Lindsley 91f317c76d Added a ``checksetup`` management command for verifying Django compatibility. 2013-06-13 18:39:02 -07:00
Loic Bistuer 9e50833e22 Fixed #20000 -- Allowed ModelForm meta overrides for label, help_text and error_messages 2013-06-13 15:06:25 -04:00
Baptiste Mispelon dc9c359546 Fixed #20594 -- Add validation to models.SlugField.
Thanks carbonXT for the report.
2013-06-13 13:31:57 -04:00
Tim Graham 92c49d6f01 Revert "Fixed #20462 - Fixed sqlite regex lookups for null values and non-string fields."
This reverts commit 64041f0e6e.

lookup.tests.LookupTests.test_regex_non_string fails under Postgres.
We should also try to rewrite the test using an existing model.
2013-06-11 17:55:19 -04:00
Axel Haustant 64041f0e6e Fixed #20462 - Fixed sqlite regex lookups for null values and non-string fields. 2013-06-11 14:13:40 -04:00
Gabe Jackson 584bd14dcf Fixed #18134 -- BoundField.label_tag now includes the form's label_suffix
There was an inconsistency between how the label_tag for forms were
generated depending on which method was used: as_p, as_ul and as_table
contained code to append the label_suffix where as label_tag called on a
form field directly did NOT append the label_suffix. The code for
appending the label_suffix has been moved in to the label_tag code of
the field and the HTML generation code for as_p, as_ul and as_table now
calls this code as well.

This is a backwards incompatible change because users who have added the
label_suffix manually in their templates may now get double label_suffix
characters in their forms.
2013-06-10 14:23:15 -04:00
Florian Apolloner af70dfcf31 Reverted the introduction of shared_models.
The recent improvements should make shared_models obsolete.

This reverts commit 1059da8de6, reversing
changes made to 4fa7f3cdd9.
2013-06-10 12:34:47 +02:00
Florian Apolloner f5d4849cbe Revert "Began implementing a shared set of test models to speed up tests."
This reverts commit 22b7870e40.
2013-06-10 12:22:40 +02:00
Aymeric Augustin dfcce4288a Fixed available_apps for selenium tests.
Refs #20483.
2013-06-10 12:11:46 +02:00
Aymeric Augustin c6e6d4eeb7 Defined available_apps in relevant tests.
Fixed #20483.
2013-06-10 11:30:01 +02:00
Aymeric Augustin 7a65c95d42 Refactored file_storage tests to avoid depending on servers tests. 2013-06-10 11:16:15 +02:00
Tim Graham 96c71d423d Added runserver validation to detect if DEBUG=False and ALLOWED_HOSTS is empty.
Refs #19875.
2013-06-09 15:08:29 -04:00
Stephen Burrows e2518fdf46 Fixed #12337 - Honor ModelForm.Meta.exclude when saving ManyToManyFields.
Thanks margieroginski for the report.
2013-06-06 10:01:48 -04:00
Claude Paroz b67f2ac8e6 Fixed #20502 (again) -- More i18n cache flush in tests
Thanks Timo Graham for noticing the failures.
2013-06-06 14:28:58 +02:00
Marc Tamlyn 9ed971f4f1 Merge pull request #1245 from oinopion/list_select_related
Fixed #19080 -- Fine-grained control over select_related in admin
2013-06-06 01:27:05 -07:00
Anssi Kääriäinen 31fd64ad8a Fixed #20564 -- Generic relations exclude() regression
The patch for #19385 caused a regression in certain generic relations
.exclude() filters if a subquery was needed. The fix contains a
refactoring to how Query.split_exclude() and Query.trim_start()
interact.

Thanks to Trac alias nferrari for the report.
2013-06-06 01:54:46 +03:00
Tomek Paczkowski 0fd9f7c95f Fixed #19080 -- Fine-grained control over select_related in admin 2013-06-05 23:08:00 +02:00
Anssi Kääriäinen 8c5b805ca1 PEP 8 cleanup 2013-06-05 21:18:56 +03:00
Bojan Mihelac b00c6371af Fixed #17927 -- Added initial values support for BaseGenericInlineFormSet
Thanks Fak3 for the suggestion.
2013-06-05 07:59:59 -04:00
Tim Graham a35ed20241 Fixed #18924 -- Made test.Client.logout send user_logged_out signal.
Thanks awsum for the suggestion and Pavel Ponomarev and
Florian Hahn for the patch.
2013-06-04 12:39:09 -04:00
Ramiro Morales e71b63e280 Added i18n-related URL mapper test for a mailing list report. 2013-06-04 11:19:27 -03:00
Aymeric Augustin 51aa000378 Fixed #20485 -- Refactored loaddata for speed.
Thanks Anssi for reporting this performance bottleneck.
2013-06-02 20:39:45 +02:00
Tim Graham 61524b09cf Fixed #18388 - Added InlineModelAdmin.get_max_num hook.
Thanks d.willy.c.c@ for the suggestion and Melevir and Areski Belaid for work
on the patch.
2013-06-01 18:20:54 -04:00
Tim Graham fffb55860e Changed assertEquals -> assertEqual. 2013-06-01 06:31:25 -04:00
Claude Paroz de66b56790 Fixed #18481 -- Wrapped request.FILES read error in UnreadablePostError
Thanks KyleMac for the report, André Cruz for the initial patch and
Hiroki Kiyohara for the tests.
2013-06-01 10:26:46 +02:00
Anssi Kääriäinen 369b6fab25 Fixed #18169 -- NoReverseMatch not silenced if from block.super 2013-06-01 00:59:04 +03:00
Anssi Kääriäinen 84909377f2 Fixed #18785 -- Added Test join trimming regression
The regression was caused by patch to ticket #15316 and was fixed by a
patch to #10790.
2013-06-01 00:28:44 +03:00
Chris Wilson fa7cb4ef3c Fixed #20404 -- Added a keys() method to ContextList.
It's useful to be able to list all the (flattened) keys of a
ContextList, to help you figure out why the variable that's supposed
to be there is not.

No .values() or .items() added as the definition for those aren't clear.

The patch is Chris Wilson's patch from pull request 1065 with some
modifications by committer.
2013-06-01 00:04:06 +03:00
Loic Bistuer 23e1b59cf2 Fixed #18681 -- BaseModelAdmin.get_form and InlineModelAdmin.get_formset no longer bypass get_fieldsets
Thanks msopacua for the report.
2013-05-31 12:48:51 -04:00
Anssi Kääriäinen 728d3fe1ba Fixed #16436 -- Oracle defer_regress test failure
Oracle doesn't like grouping by TextField, so use CharFields instead in
models.
2013-05-31 10:11:15 +03:00
Claude Paroz 9d06c6ccc9 Fixed #20502 -- Flushed i18n caches for a defaultfilter test
Thanks Chris Wilson for the report and initial patch.
2013-05-30 20:23:14 +02:00
Tim Graham 36aecb12b8 Fixed #19425 - Added InlineModelAdmin.get_extra hook.
Thanks dave@ for the suggestion and Rohan Jain for the patch.
2013-05-30 13:48:10 -04:00
Tim Graham 7902fd74f1 Merge pull request #1027 from intgr/debug_no_exc_message
Clearer explanation when exception has no message
2013-05-30 09:53:07 -07:00
Tim Graham 5074c75a37 Fixed #16856 - Added a way to clear select_related.
Thanks Carl for the suggestion and David Cramer for the patch.
2013-05-30 11:06:05 -04:00
Tim Graham 59235816bd Fixed #20509 - Proper parsing for dumpdata --pks option.
Thanks weipin for the report and Baptiste Mispelon for the patch.
2013-05-30 10:19:13 -04:00
Tai Lee 69f7db153d Fixed #16436 -- defer + annotate + select_related crash
Correctly calculate the ``aggregate_start`` offset from loaded fields,
if any are deferred, instead of ``self.query.select`` which includes all
fields on the model.

Also made some PEP 8 fixes.
2013-05-30 08:46:31 +03:00
Anssi Kääriäinen bb80d2976b Made an app-cache test not dependent on all models in defer_regress 2013-05-30 08:46:31 +03:00
Simon Charette dcd915fcab Fixed a failure on Python 3 introduced by 5939864616.
Refs #15653.
2013-05-29 15:38:52 -04:00
Tim Graham d727518ad6 Fixed #20331 -- Allowed admin actions to serve StreamingHttpResponses
Thanks Edwin.
2013-05-29 11:25:42 -04:00
Claude Paroz 8010289ea2 Fixed #15697 -- Made sqlindexes aware of auto-created tables
Thanks mbertheau for the report and Ash Christopher for the
initial patch.
2013-05-29 15:50:26 +02:00
Tim Graham 5939864616 Fixed #15653 - Error in admin pagination tag.
Thanks jcumbo@ for the report and adamzap
and nott for the patch.
2013-05-29 09:23:08 -04:00
Tim Graham 7426e72302 Fixed #20250 - Added a regression test for negated Q + annotate
Thanks nott.
2013-05-29 08:49:42 -04:00
Tim Graham ded95ccdce Fixed #20484 -- Added model validation for GenericIPAddressField
GenericIPAddressField must not allow blank for NOT NULL fields

Thanks Erik Romijn.
2013-05-28 15:12:47 -04:00
Tim Graham a2967d5204 Fixed #20242 - Added a regression test for prefetch_related.
Issue was fixed by removal of chunked reads from
QuerySet iteration in 70679243d1.

Thanks Simeon Visser for the patch.
2013-05-28 13:37:44 -04:00
Tim Graham d321d1acf0 Fixed #20228 - Documented unique_for_date and exclude behavior.
Thanks Deepak Thukral for the patch.
2013-05-28 10:04:07 -04:00
Anssi Kääriäinen 33dd8f5442 Fixed random aggregation_regress test_more_more_more() failure
The cause was assuming that an unordered queryset returns the values
always in the same order.
2013-05-28 08:55:04 +03:00
Tim Graham 0268aba96b Fixed #20182 - admin lookup should treat 0 as False for __isnull
Thanks Benjie Chen.
2013-05-27 13:29:53 -04:00
Tim Graham d194714c0a Fixed #11603 - Added django.test.SimpleTestCase.assertFormsetError
Thank-you Martin Green for the patch.
2013-05-27 12:25:35 -04:00
Shai Berger 1e29428db2 Fixed #20013 -- A test for sqlall fails under Oracle 2013-05-27 18:34:31 +03:00
Tim Graham 90af278203 Fixed #16137 - Removed kwargs requirement for QuerySet.get_or_create
Thanks wilfred@, poirier, and charettes for work
on the patch.
2013-05-27 10:01:14 -04:00
Tim Graham 6f8627dd7f Fixed #17582 - Added message to DoesNotExist exceptions.
Thanks simon@ for the suggestion and JordanPowell
for the initial patch.
2013-05-27 07:57:06 -04:00
Anssi Kääriäinen d467e11785 Fixed #20507 -- SubqueryConstraint alias relabeling
The SubqueryConstraint defined relabeled_clone(), but that was never
called. Instead there is now clone() and relabel_aliases() methods for
SubqueryConstraint.

A related problem was that SubqueryConstraint didn't correctly use
quote_name_unless_alias() of the outer query. This resulted in failures
when running under PostgreSQL.
2013-05-27 12:25:29 +03:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Preston Holmes d228c1192e Fixed #19866 -- Added security logger and return 400 for SuspiciousOperation.
SuspiciousOperations have been differentiated into subclasses, and
are now logged to a 'django.security.*' logger. SuspiciousOperations
that reach django.core.handlers.base.BaseHandler will now return a 400
instead of a 500.

Thanks to tiwoc for the report, and Carl Meyer and Donald Stufft
for review.
2013-05-25 16:27:34 -07:00
Shai Berger 36d47f72e3 Fixed get_or_create...test_savepoint_rollback test for Python3
The test was always skipped on Python3 because string literals are unicode
2013-05-26 01:53:24 +03:00
Shai Berger cf159e5c93 Fix get_or_create test failure under Oracle
Test expected that when given invalid utf-8, the backend should raise
a DatabaseError, but the Oracle backend raises a UnicodeDecodeError.
2013-05-26 01:39:34 +03:00
Andrew Jesaitis 31f6421b13 Fixed #19938 -- Consumed iterator only once in paginator's Page
Thanks Joshua Fialkoff for the report.
2013-05-25 16:27:26 +02:00
Baptiste Mispelon 2ee447fb5f Fixed #20296 -- Allowed SafeData and EscapeData to be lazy 2013-05-25 16:06:44 +02:00
Claude Paroz be0bab1bb8 Fixed #11725 -- Made possible to create widget label tag without "for"
Thanks Denis Martinez for the report and initial patch, and
Sergey Kolosov for bringing the patch up to date.
2013-05-25 15:31:07 +02:00
Claude Paroz f940e564e4 Fixed #20099 -- Eased subclassing of BrokenLinkEmailsMiddleware
Thanks Ram Rachum for the report and the initial patch, and Simon
Charette for the review.
2013-05-25 12:10:53 +02:00
Vlastimil Zíma 6de81d65f4 Fixed #14825 -- LocaleMiddleware keeps language
* LocaleMiddleware stores language into session if it is not present there.
2013-05-25 10:52:54 +02:00
Claude Paroz 7e95d7a930 Fixed a regression in router initialization
Regression was introduced in 6a6bb168b. Thanks Bas Peschier for the
report.
2013-05-24 20:48:02 +02:00
Luke Plant 4fd94969d8 Fixed #19607 - prefetch_related crash
Thanks to av@rdf.ru and flarno11@yahoo.de for the report.
2013-05-24 11:10:48 +01:00
Gavin Wahl 48424adaba Fixed #17648 -- Add `for_concrete_model` to `GenericForeignKey`.
Allows a `GenericForeignKey` to reference proxy models. The default
for `for_concrete_model` is `True` to keep backwards compatibility.

Also added the analog `for_concrete_model` kwarg to
`generic_inlineformset_factory` to provide an API at the form level.
2013-05-23 19:03:14 -04:00
Donald Stufft 8dda8a5ecc Removed noise from pre_syncdb signal tests
Only make assertions that actually test the functionality of the
change and not unrelated pieces.
2013-05-23 15:58:08 -04:00
Claude Paroz 499a745ae1 Fixed #20474 -- Proxied and deprecated django.db.backend 2013-05-23 15:19:12 +02:00
Claude Paroz b664cb818d Fixed #19237 (again) - Made strip_tags consistent between Python versions 2013-05-23 14:01:27 +02:00
Ramiro Morales 8c2fd050f8 Made fix for #9321 less buggy and more effective.
Don't try to be smart about building a good-looking help string
because it evaluates translations too early, simply use the same old
strategy as before. Thanks Donald Stufft for the report.

Also, actually fix the case reported by the OP by special-casing
CheckboxSelectMultiple.

Added tests.

Refs #9321.
2013-05-23 07:49:29 -03:00
Donald Stufft 3de1288042 Fixed #11398 - Added a pre_syncdb signal 2013-05-23 01:09:22 -04:00
Russell Keith-Magee 11b06532f7 Merge pull request #1198 from KrzysiekJ/http-patch-method
Fixed #20478 – Added support for HTTP PATCH method in generic views.
2013-05-22 17:19:43 -07:00
Claude Paroz 51998dffe7 Removed check for 0.15 version of gettext tools
gettext 0.15 has been released in July 2006.
2013-05-22 18:21:33 +02:00
Claude Paroz dc51ec8bc2 Fixed #19237 -- Used HTML parser to strip tags
The regex method used until now for the strip_tags utility is fast,
but subject to flaws and security issues. Consensus and good
practice lead use to use a slower but safer method.
2013-05-22 17:34:02 +02:00
Krzysztof Jurewicz ee8b810b97 Fixed #20478 – Added support for HTTP PATCH method in generic views. 2013-05-22 14:48:11 +02:00
Aymeric Augustin 0e51d8eb66 Fixed #20463 -- Made get_or_create more robust.
When an exception other than IntegrityError was raised, get_or_create
could fail and leave the database connection in an unusable state.

Thanks UloPe for the report.
2013-05-22 10:56:06 +02:00
Marc Tamlyn adeec00979 Merge pull request #246 from dekkers/ticket_18709
Fixed #18709 -- Check if initial_value is a callable
2013-05-22 00:45:07 -07:00
Anssi Kääriäinen 904084611d Fixed #19895 -- Second iterator over invalid qs raises errors
The fix was already in the patch for #18702, so only test added for
ticket #19895.
2013-05-22 08:30:41 +03:00
Jeroen Dekkers d0788c2770 Fixed #18709 -- Check if initial_value is a callable
In _get_changed_data, check if initial_value is a callable and call it
if it is.
2013-05-22 01:05:22 +02:00
Anssi Kääriäinen 70679243d1 Fixed #18702 -- Removed chunked reads from QuerySet iteration 2013-05-21 19:51:59 +03:00
Selwin Ong ea9a0857d4 Fixed #19326 -- Added first() and last() methods to QuerySet 2013-05-21 18:52:28 +03:00
Mathijs de Bruin 61a8de6f4f Fixed #6412 -- More details if a template file cannot be loaded
Report more details about template files in loader postmortem.
2013-05-21 16:59:40 +02:00
Florian Apolloner 800513e7f3 Merge pull request #1194 from ambv/python26_is_fun
Fixed a Python 2.6 regression (GzipFile can't act as a context manager)
2013-05-21 04:20:35 -07:00
Wiktor Kolodziej cec9558fba Fixed #17308 -- Enabled the use of short_description on properties in the admin. 2013-05-21 13:19:18 +02:00
Łukasz Langa c28281f9d6 Fixed a Python 2.6 regression (GzipFile can't act as a context manager) 2013-05-21 13:18:53 +02:00
Florian Apolloner b1ac241ddc Fixed test failures from 09f8652765. 2013-05-21 13:03:25 +02:00
Marc Tamlyn 09f8652765 Use assertIsInstance in tests.
Gives much nicer errors when it fails.
2013-05-21 10:42:15 +01:00
Aymeric Augustin 18856f866c Merge pull request #1191 from ambv/content_is_bytes
Fixed #20472: response.content should be bytes on both Python 2 and 3
2013-05-21 01:26:35 -07:00
Daniel Lindsley e24d486fbc Fixed #20212 - __reduce__ should only be defined for Py3+. 2013-05-21 00:49:21 -07:00
Łukasz Langa 0594fed9ff Fixed #20472: response.content should be bytes on both Python 2 and 3 2013-05-21 01:28:16 +02:00
Jorge Bastida 888c86dcf3 Fixed #20445 -- Raised original exception after command error 2013-05-20 18:59:37 +02:00
Ryan Kaskel 4280217f31 Fixed #20403 -- Ignore forms marked for deletion when validating max_num. 2013-05-20 12:13:21 -04:00
Anssi Kääriäinen 266c0bb23e Fixed #20278 -- ensured .get() exceptions do not recurse infinitely
A regression caused by d5b93d3281 made .get() error
reporting recurse infinitely on certain rare conditions. Fixed this by
not trying to print the given lookup kwargs.
2013-05-20 18:50:40 +03:00
Anssi Kääriäinen c9a96075fa Fixed #20378 -- regression in GenericRelation on abstract model
When a GenericRelation was defined on abstract model, queries on childs
of the abstract model didn't work. The problem was in the way fields and
in particular field.rel was copied from models to their children.

The regression was likely caused by #19385. Thanks to Gavin Wahl for
spotting the regression.
2013-05-20 18:02:10 +03:00
Anssi Kääriäinen f53059b411 Fixed qs.values() regression when used in subquery 2013-05-20 15:38:47 +03:00
Marc Tamlyn 6d81d5d82e Merge pull request #1181 from aaugustin/better-api-to-disable-atomic-requests
Changed API to disable ATOMIC_REQUESTS per view.
2013-05-20 00:26:06 -07:00
Carl Meyer a7dc13ec23 Fixed #20437 - marked a test-runner test as expected-fail under certain conditions. 2013-05-20 01:56:23 -04:00
Tomasz Jaskowski 022de7e139 Fixed #20449 - Corrected test sensitivity to current working dir. 2013-05-19 23:58:06 -04:00
Alex Gaynor 7c56212c71 Lower the max length for a test field so that it works on MySQL. 2013-05-19 13:58:58 -07:00
Anssi Kääriäinen 190771d003 Fixed fixtures testing failure
The failure was caused by generating the same warning from two tests.
The second time the same warning was raised it was swallowed by the
"once" simplefilter of warnings.
2013-05-19 20:53:49 +03:00
Aymeric Augustin 6633eeb886 Changed API to disable ATOMIC_REQUESTS per view.
A decorator is easier to apply to CBVs. Backwards compatibility isn't an
issue here, except for people running on a recent clone of master.

Fixed a few minor problems in the transactions docs while I was there.
2013-05-19 19:53:16 +02:00
Preston Holmes 6786920fd8 Fixed #16330 -- added --pks option in dumpdata command
Thanks to guettli for the initial ticket and patch, with additional work
from mehmetakyuz and Kevin Brolly.
2013-05-19 09:10:40 -07:00
Bozidar Benko 2d309a7043 Fixed #15961 -- Modified ModelAdmin to allow for custom search methods.
This adds a get_search_results method that users can override to
provide custom search strategies.

Thanks to Daniele Procida for help with the docs.
2013-05-19 16:45:00 +02:00
Aymeric Augustin b06f6c1618 Fixed test failure introduced in 1927bf7c91. 2013-05-19 16:23:14 +02:00
Pablo Recio 65f9e0affd Fixes #18896. Add tests verifying that you can get IntegrityErrors using get_or_create through relations like M2M, and it also adds a note into the documentation warning about it 2013-05-19 14:16:12 +02:00
Aymeric Augustin d34b1c29e2 Merge pull request #1161 from erikr/urlize-additional-test
Fixed #19070 -- Additional test for urlize and brackets
2013-05-19 04:59:15 -07:00
Aymeric Augustin f7467181aa Merge pull request #1160 from erikr/host-inet-postgres2
Fixed #11442 -- Postgresql backend casts all inet types to text
2013-05-19 04:57:10 -07:00
Erik Romijn 1927bf7c91 Fix #19070 -- Additional test for urlize and brackets 2013-05-19 13:39:21 +02:00
Erik Romijn 60d94c2a80 Fixed #11442 -- Postgresql backend casts all inet types to text 2013-05-19 13:28:09 +02:00
Łukasz Langa 660762681c Fixed #20126 -- XViewMiddleware moved to django.contrib.admindocs.middleware 2013-05-19 13:18:35 +02:00
Aymeric Augustin cb86f707a0 Fixed #12747 -- Made reason phrases customizable. 2013-05-19 13:14:54 +02:00
Aymeric Augustin 3129d19071 Merge pull request #1152 from ambv/issue11915
Fixed #11915: generic Accept-Language matches country-specific variants
2013-05-19 04:01:20 -07:00
Andrew Godwin 04e0fc029f Merge pull request #1094 from senko/ticket_11160
Fixed #11160: Formset non_form_errors returns ErrorList() if is_valid is not called
2013-05-19 03:56:14 -07:00
Andrew Godwin 7a99d1e167 Merge pull request #1134 from senko/ticket_18990
Fixed #18990: Loaddata now complains if fixture doesn't exist
2013-05-19 03:54:29 -07:00
Łukasz Langa 26e3e7ecb5 Fixed #11915: generic Accept-Language matches country-specific variants 2013-05-19 12:50:09 +02:00
Senko Rasic 65c557115f fix warnings imports in fixtures tests 2013-05-19 12:49:03 +02:00
Honza Kral 4ad1eb1c14 Fixed #12674 -- provide a way to override admin validation
Moved admin validation code to classes and have those be class
attributes to the ModelAdmin classes.
2013-05-19 12:42:52 +02:00
Łukasz Langa e80636b668 Added TransRealMixin to fix i18n global state pollution in the test suite 2013-05-19 12:05:57 +02:00
Senko Rasic c44a2c40fe Fixed #18990 -- Loaddata now complains if fixture doesn't exist
If the fixture doesn't exist, loaddata will output a warning.

The fixture named "initial_data" is exceptional though; if it
doesn't exist, the warning is not emitted. This allows syncdb and
flush management commands to attempt to load it without causing
spurious warnings.

Thanks to Derega, ptone, dirigeant and d1ffuz0r for contributions
to the ticket.
2013-05-19 11:31:27 +02:00
Senko Rasic cc3b3ba93a Fixed #18990: Loaddata now complains if fixture doesn't exist
The fixture named "initial_data" is exceptional though; if it
doesn't exist, the error is not raised. This allows syncdb and
flush management commands to attempt to load it without causing
an error if it doesn't exist.
2013-05-19 10:56:09 +02:00
Andrea Crotti 5124ab7620 add comment to explain why it's necessary to do an explicit check for
Python2 and how metaclasses are defined
2013-05-19 10:36:04 +02:00
Marc Tamlyn c70ca4879e Merge pull request #1116 from elektrrrus/ticket_20234_20236
Ticket 20234 20236
2013-05-19 01:32:41 -07:00
Emil Stenström 7d77e9786a Fixed #20246 -- Added non-breaking spaces between values an units 2013-05-18 23:01:48 +02:00
Tome Cvitan caf56ad174 Fixed #20440 -- Ensured CharField's max_length/min_length are integers 2013-05-18 22:30:24 +02:00
Karol Sikora 3eba8c7f7f Fixed #20234 and #20236 -- SingleObjectMixin fixes
Added object on SingleObjectMixin returned context,
some code clanup.
2013-05-18 21:13:27 +02:00
Aymeric Augustin 0038296135 Fixed ff881aef on Python 3. 2013-05-18 20:48:47 +02:00
Shai Berger ff881aef53 Fixed #13958 -- problem reporting exception from \r-line-ended file
Thanks petrvanblokland for reporting and saz for the patch
2013-05-18 19:30:03 +03:00