Commit Graph

4348 Commits

Author SHA1 Message Date
Andrew Godwin 2ae8a8a77d Fix test running with new apps stuff/migrate actually running migrations 2013-06-19 15:36:02 +01:00
Andrew Godwin 9daf81b94e Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/loading.py
2013-06-19 12:05:23 +01: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
Andrew Godwin 91c470def5 Auto-naming for migrations and some writer fixes 2013-06-07 17:56:43 +01:00
Andrew Godwin cd809619a2 Autodetector tests 2013-06-07 15:49:48 +01:00
Andrew Godwin c7aa4b5338 Field encoding 2013-06-07 15:36:31 +01:00
Andrew Godwin 4492f06408 A bit of an autodetector and a bit of a writer 2013-06-07 15:28:38 +01:00
Andrew Godwin 3c296382b8 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/fields/related.py
2013-06-07 11:15:34 +01: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
Andrew Godwin e6f7f4533c Add an Executor for end-to-end running 2013-05-30 18:08:58 +01:00
Andrew Godwin 7f9a0b7061 Fix graph tests 2013-05-30 17:56:53 +01:00
Andrew Godwin 05929ee89b Add the start of some operation tests 2013-05-30 17:55:59 +01: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
Andrew Godwin 52d2a8b311 Add test for new __ne__ method on Promise. 2013-05-29 17:52:17 +01:00
Andrew Godwin d0ecefc2c9 Start adding operations that work and tests for them 2013-05-29 17:47:10 +01: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