Commit Graph

3800 Commits

Author SHA1 Message Date
Claude Paroz 8248d14029 Removed US localflavor-specific tests from core
Also fixes #9045.
2012-12-08 21:07:59 +01:00
Claude Paroz 04e6542b5a Fixed #19423 -- Prevented ModelAdmin sharing widgets due to formfield_overrides
Thanks joebuyer at manycycles.com for the report and Simon Charette
for the review.
2012-12-08 12:41:11 +01:00
Claude Paroz c91667338a Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-12-08 11:13:52 +01:00
Andreas Hug 66dfcc10b3 Fixed #18574 -- Make BaseFormSet.is_valid call its underlying forms' is_valid
Thanks Simon Charette for the report and the initial patch.
2012-12-06 20:00:56 +01:00
Claude Paroz 34dcf51e06 Fixed #19367 -- Fixed saving ContentFile in filesystem storage
This was not working properly when ContentFile was initialized with
an unicode string.
Thanks Alexey Boriskin for the report and the test.
2012-12-06 17:14:44 +01:00
Marc Aymerich 553838a285 Fixed #19429 -- Applied linebreaksbr to read-only fields in inlines
Applied to inlines what ec9d6b1122 did for main fieldsets.
2012-12-06 09:52:02 +01:00
Anssi Kääriäinen 632cf32b43 Fixed #19391 -- Oracle specific failure in tests
The failure was caused by using None as a choice for a CharField. To
avoid Oracle's "" <-> NULL handling the field type was changed to
IntegerField.
2012-12-04 22:49:02 +02:00
Julien Phalip c196e01100 Fixed the admin_filters tests for Postgres. 2012-12-04 10:36:56 -08:00
Claude Paroz 795ac7deda Fixed #19378 -- Ensured get_success_url returns a non-lazy URL 2012-12-04 13:22:42 +01:00
Andrew Godwin 501c7a221c Merge pull request #573 from tominsam/master
Fixed #19070: urlize template filter raises exception in some cases
2012-12-04 02:18:10 -08:00
Ramiro Morales b64d30405a Fixed #18697 -- Made values accepted for two customizable admin templates consistent.
Thanks and at cloverfastfood dot com for the report.
2012-12-04 01:13:01 -03:00
Sebastián Magrí 88e1715639 Fixed #19318 -- Ensured that the admin's SimpleListFilter options can be displayed as selected even if the lookup's first element is not a string. 2012-12-03 11:53:15 -08:00
Claude Paroz 5fa5621f57 Fixed #19416 -- Fixed multi-line commands in initial SQL files
Thanks Aymeric Augustin for detecting this regression.
2012-12-03 20:47:08 +01:00
Tom Insam 161cafb6f6 another failing test case for square brackets. 2012-12-03 12:11:32 +00:00
Aymeric Augustin baae4b8187 Fixed #19397 -- Crash on binary files in project templates.
Thanks gw 2012 at tnode com for the report.
2012-12-03 10:45:18 +01:00
Julien Phalip 2e2c4968f6 Fixed #17050 -- Added some CSS class names to the admin index pages to facilitate per-app or per-model style customizations. Thanks to scytale for the report and to H0ff1 and thiderman for their work on the patch. 2012-12-02 20:54:34 -08:00
Claude Paroz 349c4c37f8 Fixed #19015 -- Add ISO input formats to all formats 2012-12-01 14:05:52 +01:00
Claude Paroz 0eeae15056 Fixed #19354 -- Do not assume usermodel.pk == usermodel.id
Thanks markteisman at hotmail.com for the report.
2012-11-29 21:45:43 +01:00
Anssi Kääriäinen 163b471e9e Converted a couple of assertEquals -> assertEqual 2012-11-28 23:44:50 +02:00
Tai Lee 6ebf115206 Fixed #14694 -- Made ``defer()`` work with reverse relations
Reverse o2o fields are now usable with defer.
2012-11-28 18:17:10 +02:00
Danilo Bargen c10aaa70a4 Fixed #19370 -- Made date filter properly handle midnight value 2012-11-27 21:24:16 +01:00
Anssi Kääriäinen 64f6e0370a Made some tests behave nicer re connection handling 2012-11-27 19:47:20 +02:00
Aymeric Augustin 2ea80b94d7 Fixed #19362 -- Detected invalid use of @python_2_unicode_compatible.
Thanks m3wolf for the report and akaariai for reproducing the problem.
2012-11-27 09:45:37 +01:00
Edward Tjörnhammar 29d59a879e Fixed #17911 -- Ensure that admin readonly fields' display values are shown in change forms when the raw value is None. 2012-11-25 23:13:30 +01:00
Julien Phalip ae206d78f6 Fixed #17646 -- Added a get_list_filter() method to ModelAdmin. Thanks to rasca for the suggestion and to mateusgondim for the patch. 2012-11-25 20:39:23 +01:00
Claude Paroz f26b956e80 Fixed test failure following capitalization fix in 2f035a972 2012-11-25 19:54:38 +01:00
Aymeric Augustin 7644800070 Change exception type to reduce confusion.
TemplateSyntaxError is expected at compile time, not at run time.

Refs #19280.
2012-11-25 19:51:42 +01:00
Aymeric Augustin f89901dc05 Fixed two typos. 2012-11-25 19:31:53 +01:00
Claude Paroz a5d47415f4 Enabled SimpleTestCase to be decorated by override_settings
Refs #18417. Also fixed some test case classes which subclassed
the wrong parent.
2012-11-25 19:06:17 +01:00
Claude Paroz 9f7cefd505 Fixed #18417 -- Raised exception when unittest.TestCase is decorated with override_settings 2012-11-25 19:06:17 +01:00
Aymeric Augustin d266919584 Fixed #19280 -- Raised an explicit exception for the old {% url %} syntax. 2012-11-24 22:10:51 +01:00
Aymeric Augustin 690cac3a34 Used a django.test.TestCase for compatibility with @override_settings.
These tests were silently skipped.
2012-11-24 22:10:51 +01:00
Anssi Kääriäinen dc569c8801 Fixed ordering-related failure in m2m_through_regress tests 2012-11-24 16:03:21 +02:00
Chris Khoo bf1871d874 Fixed #19237 -- Improved strip_tags utility
The previous pattern didn't properly addressed cases where '>'
was present inside quoted tag content.
2012-11-24 12:16:52 +01:00
Russell Keith-Magee 18d7c1ea3a Simplified the deletions performed by the swappable_models test.
This is required to allow the test to run without error under SQLite in the CI environment.
2012-11-24 15:07:50 +08:00
Russell Keith-Magee c8985a8a73 Fixed #19806 -- Ensure that content types and permissions aren't created for swapped models.
Thanks to rizumu for the report.
2012-11-24 13:43:20 +08:00
Anssi Kääriäinen 0a0a0d66b3 Fixed #19351 -- SQLite bulk_insert of more than 500 single-field objs 2012-11-24 01:13:12 +02:00
Anssi Kääriäinen a27582484c Fixed SQLite's collapsing of same-valued instances in bulk_create
SQLite used INSERT INTO tbl SELECT %s UNION SELECT %s, the problem
was that there should have been UNION ALL instead of UNION.

Refs #19351
2012-11-24 01:12:17 +02:00
Anssi Kääriäinen 90b86291d0 Fixed #18375 -- Removed dict-ordering dependency for F-expressions
F() expressions reuse joins like any lookup in a .filter() call -
reuse multijoins generated in the same .filter() call else generate
new joins. Also, lookups can now reuse joins generated by F().

This change is backwards incompatible, but it is required to prevent
dict randomization from generating different queries depending on
.filter() kwarg ordering. The new way is also more consistent in how
joins are reused.
2012-11-23 19:53:04 +02:00
Aymeric Augustin 2875b5dcab Tweak a test to avoid hitting a limit with SQLite.
Django cannot delete more than 999 objects at a time with SQLite.

Refs #16426, #16039.
2012-11-23 10:02:18 +01:00
Tim Graham 0e3690d230 Fixed #18974 - Warned against using models.permalink
Thanks dstufft for the draft patch.
2012-11-22 16:08:51 -05:00
Aymeric Augustin a026e480da Fixed #16039 -- Made post_syncdb handlers multi-db aware.
Also reverted 8fb7a90026. Refs #17055.
2012-11-22 20:53:59 +01:00
George Hickman ea6b95dbec Fixed #19316 -- Set View args/kwargs/request before dispatch 2012-11-22 20:13:01 +01:00
Jannis Leidel 3fb83729b9 Merge branch 'ticket_19325' of https://github.com/hannesstruss/django into hannesstruss-ticket_19325 2012-11-22 10:05:08 +01:00
Julien Phalip 693b8a65ad Modified a staticfiles test to use a unicode character that has just one single representation. The previously used character (ş) has two different representations (u'\u015f' and u's\u0327'), which caused spurious failures when the tests were run across multiple platforms (e.g. on a Linux VM hosted on a Mac). 2012-11-21 09:52:09 +01:00
Claude Paroz b781354ad1 Updated assertions in pagination test
assertEquals is a deprecated assertion alias.
2012-11-21 09:06:21 +01:00
Chris Beaven 48e8b5e944 Add orphans support to MultipleObjectMixin
Fixes #7005
2012-11-21 16:50:23 +13:00
Chris Beaven fbfa654a15 Paginator._get_page hook
This allows for Paginator subclasses to easily override the Page class
that gets used.

Took the opportunity to also do some non-invasive PEP8 tidying of the
paginator module.
2012-11-21 15:19:44 +13:00
Hannes Struss f9891f2087 Fixed #19325 - Made email backend of AdminEmailHandler configurable 2012-11-20 11:23:12 +01:00
Preston Holmes edf7ad36fa Fixed #18658 -- Improved ModelAdmin.message_user API
Thanks to Lowe Thiderman for the patch and tests
2012-11-19 16:03:09 -08:00
Jannis Leidel 778b8bdcf4 Merge pull request #467 from tomchristie/page-kwarg
Add 'page_kwarg' attribute to `MultipleObjectMixin`, removing hardcoded "page".
2012-11-17 12:27:01 -08:00
Claude Paroz e0363c688d Fixed #19114 -- Fixed LogEntry unicode representation
Thanks niko at neagee.net for the report and Emil Stenstrom for
the patch.
2012-11-17 19:19:59 +01:00
Claude Paroz 2a67374b51 Fixed #19036 -- Fixed base64 uploads decoding
Thanks anthony at adsorbtion.org for the report, and johannesl for
bringing the patch up-to-date.
2012-11-17 17:25:21 +01:00
Claude Paroz ec9d6b1122 Fixed #19226 -- Applied linebreaksbr to read-only fields in admin
Thanks shadow for the report, and Melevir and thiderman for the
patch.
2012-11-17 17:06:24 +01:00
Jannis Leidel f79013843d Fixed typo introduced in 4a5e8087ac. 2012-11-17 16:00:19 +01:00
Jannis Leidel 233f86443c Merge pull request #490 from gabrielhurley/reverse-prefix-special-chars
Fixed #18210 -- Escaped special characters in reverse prefixes.
2012-11-17 06:49:18 -08:00
Jannis Leidel 4a5e8087ac Fixed #19136 -- Properly escape gettext context prefixes in the i18n JavaScript view template. 2012-11-17 15:37:30 +01:00
Preston Holmes 44046e8a38 Fixed #18985 -- made DeprecationWarnings loud
Capture warnings in Python >= 2.7 and route through
console handler, which is subject to DEBUG==True

Thanks to dstufft for the idea, and claudep for initial patch
2012-11-16 17:07:38 -08:00
Anssi Kääriäinen 71e14cf3aa Fixed #18347 -- Removed autofield raw SQL inserts from tests 2012-11-15 17:31:08 +02:00
Anssi Kääriäinen f51e409a5f Fixed #13781 -- Improved select_related in inheritance situations
The select_related code got confused when it needed to travel a
reverse relation to a model which had different parent than the
originally travelled relation.

Thanks to Trac aliases shauncutts for report and ungenio for original
patch (committed patch is somewhat modified version of that).
2012-11-15 17:15:21 +02:00
Claude Paroz 550ddc66b4 Fixed #19272 -- Fixed gettext_lazy returned type on Python 2
Thanks tyrion for the report.
2012-11-14 10:50:15 +01:00
Claude Paroz 1620c27936 Fixed #19186 -- Fixed sending mail with unicode content on Python 3
Thanks alex_po for the report and Luke Plant for the analysis.
2012-11-14 10:43:33 +01:00
Aymeric Augustin 4c5cea7073 Merge pull request #218 from mgrouchy/ticket_18582
Fixed #18582 -- Added a no-op close to BaseCache
2012-11-11 07:18:45 -08:00
Claude Paroz 34162698cc Fixed #14264 -- Ensured settings.configure configures logging
Thanks Matt McDonald for the patch.
2012-11-10 12:05:58 +01:00
Sean Breant 4d817b3887 Fixed #19262 -- Support cookie pickling in SimpleTemplateResponse
Refs #15863.
2012-11-09 21:07:53 +01:00
Claude Paroz 1b307d6c8f Fixed #19261 -- Delayed Queryset evaluation in paginators
Thanks trbs for the report and the patch.
2012-11-09 19:41:57 +01:00
Claude Paroz 45802e1248 Merged pagination tests
It is simpler/cleaner to have all pagination tests in a single file.
Refs #16122.
2012-11-08 11:07:16 +01:00
Anssi Kääriäinen cafb266954 Fixed #17144 -- MySQL again groups by PK only
Thanks to Christian Oudard for the report and tests.
2012-11-08 00:56:32 +02:00
Claude Paroz 79dd751b0b Fixed #14315 -- Made memcached backend handle negative incr/decr values
Thanks Michael Manfre for the report and initial patch and
Tobias McNulty for the review.
2012-11-06 12:22:42 +01:00
Claude Paroz 78f66691ee Fixed #8627 -- Prevented textareas to swallow first newline content
Browsers consider the first newline in textareas as some display
artifact, not real content. Hence they are not sending it back to
the server. If we want to keep initial newlines, we have to add one
when we render the textarea.
Thanks bastih for the report and initial patch.
2012-11-05 20:27:06 +01:00
Preston Holmes 6bd61194d4 Fixed py3 compatibility for 5a00a57aa5 2012-11-04 23:38:41 -08:00
Anton I. Sipos fdea2621cd Fixed #18949 -- Fix broken test interactions in ModelForms tests
A test in Model Forms test was specifically referring to a fixed
primary key, which was now being used up in a newly committed.
This has been worked around by specifying a higher primary
key.
2012-11-04 18:43:11 -08:00
Alex Gaynor 4d766b3c9a Merge pull request #495 from aisipos/ticket_18949
Fixed #18949 -- Improve performance of model_to_dict with many-to-many
2012-11-04 15:57:45 -08:00
Anton I. Sipos e44ab5bb4f Fixed #18949 -- Improve performance of model_to_dict with many-to-many
When calling model_to_dict, improve performance of the generated SQL by
using values_list to determine primary keys of many to many objects. Add
a specific test for this function, test_model_to_dict_many_to_many

Thanks to brian for the original report and suggested fix.
2012-11-04 15:52:05 -08:00
Preston Holmes 5a00a57aa5 Fixed #19240 -- include pagination error details in ListView 404
Thanks to seawolf for the patch
2012-11-04 15:52:00 -08:00
Mike Johnson fcd3d4c68f model_split: Fixed #19236 - fixed error for abstract models with a split method 2012-11-04 13:43:54 -08:00
Alex Gaynor 4285571c5a Fixed #5805 -- it is now possible to specify multi-column indexes. Thanks to jgelens for the original patch. 2012-11-04 10:16:06 -08:00
Aymeric Augustin 973f539ab8 Fixed #15152 -- Avoided crash of CommonMiddleware on broken querystring 2012-11-03 21:28:33 +01:00
Gabriel Hurley 90e530978d Fixed #18210 -- Escaped special characters in reverse prefixes.
Ensured that special characters passed in to reverse via the
prefix argument are properly escaped so that calls to
django.utils.regex_helpers.normalize and/or string formatting
operations don't result in exceptions.

Thanks to toofishes for the error report.
2012-11-03 13:06:57 -07:00
Aymeric Augustin 095eca8dd8 Fixed #19101 -- Decoding of non-ASCII POST data on Python 3.
Thanks Claude Paroz.
2012-11-03 13:03:15 +01:00
Ulrich Petri ac2052ebc8 Fixed #17549 -- Added a clickable link for URLFields in admin change list. 2012-11-03 11:57:33 +01:00
Tim Graham feaf9f279a Fixed #15361 - Documented performance considerations for QuerySet.get()
Thanks mmcnickle for the patch.
2012-11-02 17:58:24 -04:00
Andrew Godwin 7f75460fd6 Fixed #19070 -- urlize filter no longer raises exceptions on 2.7
Thanks to claudep for the patch.
2012-10-31 10:58:14 +00:00
Anssi Kääriäinen 68847135bc Removed dupe_avoidance from sql/query and sql/compiler.py
The dupe avoidance logic was removed as it doesn't seem to do anything,
it is complicated, and it has nearly zero documentation.

The removal of dupe_avoidance allowed for refactoring of both the
implementation and signature of Query.join(). This refactoring cascades
again to some other parts. The most significant of them is the changes
in qs.combine(), and compiler.select_related_descent().
2012-10-31 08:19:44 +02:00
Claude Paroz 73245b3285 Prevented file_upload tests to leave files behind
Refs #19206.
2012-10-30 22:27:55 +01:00
Claude Paroz 9a02851340 Fixed #17744 -- Reset default file storage with setting_changed signal 2012-10-30 22:23:28 +01:00
Claude Paroz 6de6988f99 Fixed #5076 -- Properly decode POSTs with non-utf-8 payload encoding
Thanks daniel at blogg.se for the report and Aymeric Augustin for
his assistance on the patch.
2012-10-30 09:00:32 +01:00
Claude Paroz d30516e163 Prevented leftover files and dirs in admin_scripts tests 2012-10-29 19:08:07 +01:00
Luke Plant 4c4d08502c Fixed #17991 - prefetch_related fails with GenericRelation and varchar ID field
Thanks to okke@formsma.nl for the report, and carmandrew@gmail.com for the tests.
2012-10-29 14:31:54 +00:00
Claude Paroz f1cc2be0c5 Fixed #18575 -- Empty DATABASES should default to dummy backend
Thanks delormemarco@gmail.com for the report.
2012-10-28 23:44:03 +01:00
Aymeric Augustin b4420d9602 Fixed #18964 -- floatformat test passes under py3k
Thanks Russell for the report.
2012-10-28 19:57:03 +01:00
Anssi Kääriäinen 611c4d6f1c Fixed #18823 -- Ensured m2m.clear() works when using through+to_field
There was a potential data-loss issue involved -- when clearing
instance's m2m assignments it was possible some other instance's
m2m data was deleted instead.

This commit also improved None handling for to_field cases.
2012-10-28 17:31:35 +02:00
Anssi Kääriäinen a5152bb646 Marked a test as expectedFailure on Oracle 2012-10-27 18:34:18 +03:00
Anssi Kääriäinen 2249bd275c Fixed Oracle failure for "%" in table name 2012-10-27 05:26:42 +03:00
Aymeric Augustin 789ea3342d Fixed comment_test tests under hash randomization.
Thanks clelland for the patch.
2012-10-26 22:47:45 +02:00
Aymeric Augustin 46d27a6b8d Fixed feedgenerator tests under hash randomization 2012-10-26 22:40:35 +02:00
Aymeric Augustin 195bc37f1d Fixed httpwrappers tests under hash randomization 2012-10-26 22:09:48 +02:00
Claude Paroz be29329ccd Fixed #16820 -- Treated '0' value as True for checkbox inputs
Thanks Dan Fairs for the report and the initial patch.
2012-10-26 20:44:00 +02:00
Luke Plant fabe9c9e5f Fixed test failure under Python 2.x introduced in 3e10d22df5 2012-10-26 02:45:15 +01:00
Luke Plant 3e10d22df5 Fixed test failures on Python 3.3 due to dict ordering assumptions.
Refs #19038
2012-10-26 02:13:09 +01:00
Luke Plant c8508943a2 Fixed some test failures on Python 3.3 related to QueryDict
Refs #19038.
2012-10-26 01:55:55 +01:00
Ian Clelland bdcd2f6b10 Avoid dependence on exact Python exception messages 2012-10-26 01:40:33 +01:00
Ian Clelland 02dda22832 Don't use : as an invalid cookie character
Since http://bugs.python.org/issue2193 has been resolved in favour of
the colon in cookie names, we need to test invalid cookie removal using
a different character. "@" is still considered invalid by all sources.
2012-10-26 01:40:32 +01:00
Luke Plant 71734dfa72 Fixed #19039 - Python 3.3 fails unit test for duplicate bad cookies
Thanks to clelland for the report.
2012-10-26 00:50:25 +01:00
Luke Plant f3a2bcdee9 Fixed #15040 - Boolean fields return 0 and 1 when loaded through select_related
Thanks to homm for the report and ramiro for the patch.
2012-10-26 00:25:59 +01:00
Aymeric Augustin 1d6b7f302a Fixed timezone tests when dict randomization is on
Refs #17758.
2012-10-25 23:14:17 +02:00
Anssi Kääriäinen 7de439f32d Fixed #19187 -- Raise consistent error from qs.values().delete() 2012-10-25 17:16:56 +03:00
Anssi Kääriäinen f64a5ef404 Fixed #19102 -- Fixed fast-path delete for modified SELECT clause cases
There was a bug introduced in #18676 which caused fast-path deletes
implemented as "DELETE WHERE pk IN <subquery>" to fail if the SELECT
clause contained additional stuff (for example extra() and annotate()).

Thanks to Trac alias pressureman for spotting this regression.
2012-10-25 17:16:44 +03:00
Tom Christie f824a95177 Test for `ListView.page_kwarg` 2012-10-25 13:19:53 +01:00
Aymeric Augustin da56e1bac6 Fixed #18796 -- Refactored conversion to bytes in HttpResponse
Thanks mrmachine for the review.
2012-10-25 08:49:51 +02:00
Aymeric Augustin 82b3e6ffcb Fixed #13222 -- Made HttpResponse iterable once
response.content can be accessed many times as desired, and always
returns the same result.

iter(response) works only once and consumes the iterator.
2012-10-24 17:19:56 +02:00
Aymeric Augustin 495a8b8107 Fixed #6527 -- Provided repeatable content access
in HttpResponses instantiated with iterators.
2012-10-24 17:08:37 +02:00
Aymeric Augustin 83041ca802 Fixed a DeprecationWarning under Python 3. 2012-10-24 16:52:21 +02:00
Claude Paroz 9fd2f9c5f3 Fixed #19088 -- Always escape % inside blocktrans tag
Thanks vlinhart for the report and Łukasz Rekucki for the patch.
2012-10-23 18:49:22 +02:00
Carl Meyer 3541a10d49 Fixed #19164 -- Fixed diffsettings command broken in fix for #18545.
Thanks Mario César for the report and draft patch.
2012-10-22 18:49:08 -06:00
Aymeric Augustin ea57112d53 Reverted 6a64822bf4.
This commit caused every test that does two or more assertContains to
fail, because of #6527. It also made HttpResponse non-pickleable.

Refs #13222.
2012-10-23 00:11:17 +02:00
Aymeric Augustin 6a64822bf4 Fixed #13222 -- Repeated iteration of HttpResponse
Thanks teepark for the report and grahamd for his insights.
2012-10-22 22:52:36 +02:00
Claude Paroz e70170c2cb Cleaned up i18n regression tests 2012-10-22 14:45:41 +02:00
Aymeric Augustin 5e629a015e Added tests for conditional_content_removal.
Refs #7581. Thanks mrmachine.
2012-10-21 22:40:31 +02:00
Claude Paroz 22471a41ba Merge pull request #457 from JanBednarik/ticket_19142
Fixed #19142 -- Language codes can include numbers (RFC 3066)
2012-10-21 10:35:01 -07:00
Alex Gaynor 6b3d2bc981 Merge pull request #444 from mitar/patch-2
Allow reversed iteration over SortedDict.
2012-10-20 20:39:49 -07:00
Jan Bednařík e6b34193c5 Fixed #19142 -- Language codes can include numbers (RFC 3066). 2012-10-21 01:25:35 +02:00
Jan Bednařík b87e2f46c8 Fixed #19151 -- Added missing methods to EmptyQuerySet.
Added values() and values_list() methods to EmptyQuerySet.
2012-10-21 00:19:38 +02:00
Aymeric Augustin d7c6a57d60 Used @override_settings in several tests. 2012-10-20 23:22:46 +02:00
Aymeric Augustin 4b27813198 Fixed #7581 -- Added streaming responses.
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-10-20 20:05:11 +02:00
Claude Paroz cfb3eb2e3d Used FakePayload in requests tests 2012-10-20 15:54:26 +02:00
Claude Paroz dcbf08cce5 Fixed #19094 -- Improved FakePayload to support write, len and string input
Thanks Ondrej Slinták for the suggestion.
2012-10-20 15:36:24 +02:00
Claude Paroz dfd4a71751 Fixed #5611 -- Restricted accepted content types in parsing POST data
Thanks paulegan for the report and Preston Holmes for the review.
2012-10-20 14:56:16 +02:00
Claude Paroz 681550ca6d Removed custom WSGIRequestHandler.get_environ
We probably historically customized it for good reasons, but
currently, the differences with upstream Python are not
significant any longer.
Also fixes #19075 for which a test has been added.
2012-10-20 13:55:13 +02:00
Ramiro Morales 0b908b92a2 Fixed #8001 -- Made redirections after add/edit in admin customizable.
Also fixes #18310.
2012-10-18 20:58:52 -03:00
Preston Holmes 4fb510fde4 Added missed poisoned host header tests 2012-10-18 11:10:46 -07:00
Claude Paroz 6b0a836c9c Fixed assertXMLEqual when first node was a comment 2012-10-15 23:05:40 +02:00
Mitar 2811e543c6 Added tests for reversed iteration over SortedDict. 2012-10-15 12:12:10 -07:00
Ludovic Delaveau 7a44dc555a Fixed #16479 - Forms generated from formsets use ErrorList instead of supplied error_class
Patch with tests from charettes, updated.
2012-10-13 15:28:20 +01:00
Adrian Holovaty ffbc599f77 Removed country-specific localflavor tests.
They now live in separate django-contrib-XX packages.
2012-10-12 16:21:51 -05:00
Tim Graham 06f5da3d78 Fixed #16817 - Added a guide of code coverage to contributing docs.
Thanks Pedro Lima for the draft patch.
2012-10-11 06:11:52 -04:00
Anssi Kääriäinen 041ef9ed68 Removed some uses of F() expression & and |
Refs #16211
2012-10-10 03:31:11 +03:00
Michael Manfre 32ac067a6d Fixed #18927 -- Fixed bulk_create tests when no has_bulk_insert 2012-10-10 01:39:43 +03:00
Anssi Kääriäinen b625e8272b Moved F() '&' and '|' to .bitand() and .bitor()
Done for consistency with Q() expressions and QuerySet combining. This
will allow usage of '&' and '|' as boolean logical operators in the
future. Refs #16211.
2012-10-10 01:15:29 +03:00
Anssi Kääriäinen a8b1861fc4 Revert "Fixed #16211 -- Added comparison and negation ops to F() expressions"
This reverts commit 28abf5f0eb.

Conflicts:

	docs/releases/1.5.txt
2012-10-10 01:15:29 +03:00
Anssi Kääriäinen 7f4dbdc036 Revert "Splitted expressions tests into smaller methods"
This reverts commit c2532825db.
2012-10-10 01:15:29 +03:00
Claude Paroz 252cd271e8 Fixed test failure after IDN domain validation fix
Refs #17867.
The address in test_email_regexp_for_performance used to take forever
(security issue), then was supposed to fail after the fix (commit 9f8287a3f).
Now we are less strict with domain validation, due to new IDN domains,
hence the validation of this address pass now.
2012-10-09 22:44:43 +02:00
Aymeric Augustin 3190abcd75 Fixed #18153 -- Reverse OneToOne lookups on unsaved instances.
Thanks David Hatch and Anssi Kääriäinen for their inputs.
2012-10-09 21:36:35 +02:00
Aymeric Augustin c9b4e9ac3a Fixed #19095 -- invalid code in multidb tests. 2012-10-09 21:23:02 +02:00
Claude Paroz 273b96ef9d Fixed #17867 -- Made email validation pass with IDN domains
Thanks Pierre Matri for the report and the initial patch.
2012-10-09 15:08:32 +02:00
Claude Paroz 8cb9968a91 Moved some email validation tests to validators tests 2012-10-09 15:08:32 +02:00
Claude Paroz a8f888feb4 Improved assertion error messages in validators tests 2012-10-09 15:08:22 +02:00
Anssi Kääriäinen a62d53c032 Fixed #19087 -- Ensured query's base table is never LOUTER joined
This fixes a regression created by join promotion logic refactoring:
01b9c3d519

Thanks to Ivan Virabyan for the report.
2012-10-08 18:40:09 +03:00
Claude Paroz 4797ad80da [py3] Decoded the parsed source file encoding in debug view 2012-10-08 10:06:56 +02:00
Ramiro Morales 35e8dc5169 Removed ad-hoc support for usage of short names of built-in DB backends.
This non-standard naming was deprecated in Django 1.2.
2012-10-06 23:27:08 -03:00
Claude Paroz 117e99511e Added assertXML[Not]Equal assertions
This is especially needed to compare XML when hash randomization
is on, as attribute order may vary. Refs #17758, #19038.
Thanks Taylor Mitchell for the initial patch, and Ian Clelland for
review and cleanup.
2012-10-06 13:14:50 +02:00
Russell Keith-Magee cc337a74f1 Fixed #19069 -- Improved the error message when trying to query a swapped model.
Thanks to Preston Holmes for the suggestion.
2012-10-06 14:21:57 +08:00
Stephen Burrows 218abcc9e5 Fixed #14567 -- Made ModelMultipleChoiceField return EmptyQuerySet as empty value 2012-10-03 20:47:35 +03:00
Russell Keith-Magee 3b6f980bed Fixed #19049 -- Ensure that swapped models aren't included in reverse field caches.
Thanks to Ivan Virabyan for the report.
2012-10-02 22:52:45 +08:00
Preston Holmes 55fa86a97f Fixed postgres rollback issue with fixture test 2012-10-01 11:36:16 -07:00
Preston Holmes e7723683dc Fixed #9279 -- Added ignorenonexistent option to loaddata
Thanks to Roman Gladkov for the initial patch and Simon Charette for review.
2012-09-30 23:40:27 -07:00
Claude Paroz 8bd7b598b6 Fixed #18807 -- Made 404.html and 500.html optional
Thanks Aymeric Augustin for the report and Jannis Leidel for the
review.
2012-09-30 23:16:19 +02:00
Claude Paroz 08d675a98f Fixed #7936 -- Added Last-Modified header to feeds
Thanks julianb for the report and the initial patch, and Roman
Gladkov for working on tests.
2012-09-30 22:40:25 +02:00
Anssi Kääriäinen c2532825db Splitted expressions tests into smaller methods 2012-09-30 17:51:11 +03:00
Anssi Kääriäinen 28abf5f0eb Fixed #16211 -- Added comparison and negation ops to F() expressions
Work done by Walter Doekes and Trac alias knoeb. Reviewed by Simon
Charette.
2012-09-30 17:51:06 +03:00
Claude Paroz f0f327bbfe Fixed #18993 -- 'django' logger logs to console when DEBUG=True
Thanks Preston Holmes for the review.
2012-09-29 22:56:18 +02:00
Florian Apolloner 6a6f589bfe Merge branch 'ticket15695' 2012-09-29 21:57:50 +02:00
Anssi Kääriäinen 1cd6e04cd4 Fixed #18676 -- Allow fast-path deletion of objects
Objects can be fast-path deleted if there are no signals, and there are
no further cascades. If fast-path is taken, the objects do not need to
be loaded into memory before deletion.

Thanks to Jeremy Dunck, Simon Charette and Alex Gaynor for reviewing
the patch.
2012-09-28 18:16:08 +03:00
Anssi Kääriäinen 3fcca0e947 Added a way to check if a signal has listeners 2012-09-28 18:10:52 +03:00
Claude Paroz 07ffe78143 Used get_current_site in comments feed class 2012-09-28 14:35:26 +02:00
Julien Phalip b8244c654c Fixed #18881 -- Made the context option in {% trans %} and {% blocktrans %} accept literals wrapped in single quotes. Thanks to lanyjie for the report. 2012-09-27 20:34:45 -07:00
Eduardo Cereto Carvalho c9c9a56425 Added complementary regression test for commit c1729510
Also fixed #18660.
2012-09-27 15:57:28 +02:00
Florian Apolloner b946db5241 Fixed #15695 -- Added `ResolverMatch` to the request object. 2012-09-27 15:06:58 +02:00
Claude Paroz 3cbe686af6 Fixed #18675 -- Fixed was_modified_since with floating-point mtime
Thanks Simon Charette for the patch.
2012-09-26 21:12:56 +02:00
Claude Paroz b3ee80a0cf Fixed parse_http_date docstring and moved related tests
Refs #18675.
2012-09-26 21:10:17 +02:00
Claude Paroz bb7da7844f Fixed #18845 -- Do not swallow AttributeErrors when running commands 2012-09-26 15:07:11 +02:00
Adrien Lemaire 2c8267bf3d Fixed #17899 -- Rewrote [Ee]-mail to [Ee]mail 2012-09-26 14:14:51 +02:00
Russell Keith-Magee 70a0de37d1 Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.

Squashed commit of the following:

commit d84749a0f0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Wed Sep 26 18:37:04 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 531e7715da
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Wed Sep 26 07:09:23 2012 +0800

    Merged recent trunk changes.

commit 29d1abbe35
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 24 07:49:46 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 8a527dda13
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 24 07:48:05 2012 +0800

    Ensure sequences are reset correctly in the presence of swapped models.

commit e2b6e22f29
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 17:53:05 2012 +0800

    Modifications to the handling and docs for auth forms.

commit 98aba856b5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 15:28:57 2012 +0800

    Improved error handling and docs for get_user_model()

commit 0229209c84
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 14:50:11 2012 +0800

    Merged recent Django trunk changes.

commit 6494bf91f2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 17 21:38:44 2012 +0800

    Improved validation of swappable model settings.

commit 5a04cde342
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 17 07:15:14 2012 +0800

    Removed some unused imports.

commit ffd535e413
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 20:31:28 2012 +0800

    Corrected attribute access on for get_by_natural_key

commit 913e1ac84c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 20:12:34 2012 +0800

    Added test for proxy model safeguards on swappable models.

commit 280bf19e94
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 18:16:49 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit dbb3900775
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 18:09:27 2012 +0800

    Fixes for Python 3 compatibility.

commit dfd72131d8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 15:54:30 2012 +0800

    Added protection against proxying swapped models.

commit abcb027190
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 15:11:10 2012 +0800

    Cleanup and documentation of AbstractUser base class.

commit a9491a8776
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 14:46:49 2012 +0800

    Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011

commit fd8bb4e3e4
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 14:20:14 2012 +0800

    Documentation improvements coming from community review.

commit b550a6d06d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:52:47 2012 +0800

    Refactored skipIfCustomUser into the contrib.auth tests.

commit 52a02f1110
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:46:10 2012 +0800

    Refactored common 'get' pattern into manager method.

commit b441a6bbc7
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:41:33 2012 +0800

    Added note about backwards incompatible change to admin login messages.

commit 08bcb4aec1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Sep 15 18:30:33 2012 +0300

    Splitted User to AbstractUser and User

commit d9f5e5addb
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Sep 15 18:30:02 2012 +0300

    Reworked REQUIRED_FIELDS + create_user() interaction

commit 579f152e4a
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:18:37 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 918497218c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:18:19 2012 +0800

    Deprecate AUTH_PROFILE_MODULE and get_profile().

commit 334cdfc1bb
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:00:12 2012 +0800

    Added release notes for new swappable User feature.

commit 5d7bb22e8d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 19:59:49 2012 +0800

    Ensure swapped models can't be queried.

commit 57ac6e3d32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 14:31:54 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit f2ec915b20
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 08:29:51 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 19526563b5
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 08:22:26 2012 +0800

    Merge recent changes from master.

commit 2c5e833a30
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 07:53:46 2012 +0800

    Corrected admin_views tests following removal of the email fallback on admin logins.

commit 20d1892491
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 01:00:37 2012 +0800

    Added conditional skips for all tests dependent on the default User model

commit 40ea8b8882
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 8 23:47:02 2012 +0800

    Added documentation for REQUIRED_FIELDS in custom auth.

commit e6aaf65970
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 8 23:20:02 2012 +0800

    Added first draft of custom User docs.

    Thanks to Greg Turner for the initial text.

commit 75118bd242
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date:   Mon Aug 20 11:17:26 2012 +0800

    Admin app should not allow username discovery

    The admin app login form should not allow users to discover the username
    associated with an email address.

commit d088b3af58
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date:   Mon Aug 20 10:32:13 2012 +0800

    Admin app login form should use swapped user model

commit 7e82e83d67
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Fri Sep 7 23:45:03 2012 +0800

    Merged master changes.

commit e29c010beb
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Aug 20 13:12:57 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 8e3fd703d0
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Aug 20 13:09:09 2012 +0800

    Merged recent changes from trunk.

commit 507bb50a92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 20:41:37 2012 +0800

    Modified auth app so that login with alternate auth app is possible.

commit dabe362836
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 20:10:51 2012 +0800

    Modified auth management commands to handle custom user definitions.

commit 7cc0baf89d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 14:17:28 2012 +0800

    Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 18:48:09 +08:00
Ramiro Morales f51eab796d Fixed #18072 -- Made more admin links use reverse() instead of hard-coded relative URLs.
Thanks kmike for the report and initial patch for the changelist->edit
object view link URL.

Other affected links include the delete object one and object history
one (in this case the change had been implemented in commit 5a9e127, this
commit adds admin-quoting of the object PK in a way similar to a222d6e.)

Refs #15294.
2012-09-24 22:02:59 -03:00
Claude Paroz 515fd6a5de Called parent __init__ in test logging handler 2012-09-24 22:42:58 +02:00
Claude Paroz fc69fff9ab Fixed #14861 -- Moved logging config outside of Settings.__init__
Thanks donspaulding for the report and simonpercivall for the
initial patch.
2012-09-24 22:12:45 +02:00
Claude Paroz e72e22e518 Replaced a deprecated assertEquals 2012-09-24 16:07:58 +02:00
Aymeric Augustin 3174b5f2f5 Fixed #18982 - Caught TypeError in DateField.clean
Thanks gwahl at fusionbox com.
2012-09-23 13:27:01 +02:00
Claude Paroz 8599f64e54 Fixed #18861 -- Triggered message validation with locmem email backend
Thanks Bruno Renié for the report and the initial patch.
2012-09-22 15:17:13 +02:00
Aymeric Augustin 822cfce3df Fixed #18951 -- Formatting of microseconds.
Thanks olofom at gmail com for the report.
2012-09-22 12:02:21 +02:00
Aymeric Augustin baa33cd8fa Fixed #16218 -- date_list order in generic CBVs.
Thanks nnrcschmdt for the report and bpeschier for the initial
version of the patch.
2012-09-22 11:47:34 +02:00
Claude Paroz 26ff2be787 Imported getLogger directly from logging module
This was a remainder of some 2.4 compatibility code.
2012-09-20 21:03:24 +02:00
Carl Meyer 4e9a74b81d Revert "Fixed #16865 -- Made get_or_create use read database for initial get query."
Thanks to Jeremy Dunck for pointing out the problem with this change. If in a
single transaction, the master deletes a record and then get_or_creates a
similar record, under the new behavior the get_or_create would find the record
in the slave db and fail to re-create it, leaving the record nonexistent, which
violates the contract of get_or_create that the record should always exist
afterwards. We need to do everything against the master here in order to ensure
correctness.

This reverts commit 901af86550.
2012-09-19 11:15:12 -06:00
Carl Meyer 901af86550 Fixed #16865 -- Made get_or_create use read database for initial get query.
Thanks Rick van Hattem for the report and trbs for the patch.
2012-09-19 10:06:53 -06:00
Jeremy Dunck 40e62a5ccd Fixed #18980 -- Fixed assertContains regression when passed an object 2012-09-18 21:05:41 +02:00
Florian Apolloner 319e135519 Fixed #18800 -- Support numbers bigger than max float in `numberformat`.
Thanks to jbvsmo for the patch and Brad Pitcher for the tests.
2012-09-18 19:43:50 +02:00
Florian Apolloner 23d0136314 Merge branch 'lotheac-fix_uploaded_file_exec' 2012-09-17 22:54:26 +02:00
Florian Apolloner e8c6aff3bf Fixed #18947 -- Don't make uploaded files executeable by default.
Thanks to Lauri Tirkkonen for the patch.
2012-09-17 22:53:10 +02:00
Florian Apolloner a630d08483 Merge pull request #360 from calebsmith/add-permalink-wraps-test
Ticket #12836 - Added a test to assure permalink wraps method attributes
2012-09-16 14:00:51 -07:00
Anssi Kääriäinen f399a804c9 Fixed #17485 regression -- only + select_related interaction
When doing deeper than one level select_related() + only queries(), the
code introduced in b6c356b7bb errored
incorrectly.

Thanks to mrmachine for report & test case.
2012-09-16 22:58:40 +03:00
Julien Phalip c555741aa7 Fixed #18530 -- Fixed a small regression in the admin filters where wrongly formatted dates passed as url parameters caused an unhandled ValidationError. Thanks to david for the report. 2012-09-15 16:20:56 -07:00
Claude Paroz b1fb6f4820 Modernized views.DebugViewTests 2012-09-15 21:07:42 +02:00
Claude Paroz 859aa2a6c4 Fixed #18790 -- Encoded database password on Python 2
Thanks thcourbon@gmail.com for the report.
2012-09-12 10:16:49 +02:00
Claude Paroz f1bdfbd24b Document and test 'type' usage in Widget attrs
Refs #16630.
2012-09-10 19:31:11 +02:00
Karen Tracey 2e92858386 Fixed a couple of test failures on Windows. 2012-09-09 15:07:04 -04:00
Carl Meyer a3b2136b28 Remove an outdated import inadvertently introduced in tests. 2012-09-08 18:22:03 -06:00
Carl Meyer a78dd109e6 Fixed #15552 -- LOGIN_URL and LOGIN_REDIRECT_URL can take URLpattern names.
Thanks UloPe and Eric Florenzano for the patch, and Malcolm Tredinnick for
review.
2012-09-08 16:58:35 -06:00
Carl Meyer 307706d082 Fixed #18545 -- Make the 'no DJANGO_SETTINGS_MODULE' error message more useful.Thanks Nick Coghlan for the report, and Malcolm Tredinnick for review. 2012-09-08 14:26:33 -06:00
Travis Swicegood 4754f122dd Moved the admin inline JS to new JS files for cleanliness. 2012-09-08 15:09:37 -04:00
Caleb Smith 210fd7c658 refs #12836 - Added a test to assure permalink wraps method attributes 2012-09-08 11:58:48 -04:00