Commit Graph

3991 Commits

Author SHA1 Message Date
Florian Apolloner 41d7a9a907 Moved test_templates to templates to prevent issues with regressiontests/templates later on. 2013-02-26 14:36:57 +01:00
Aymeric Augustin 8dd8400f7e Updated an inaccurate comment.
Tests can run nearly as fast under PostgreSQL and MySQL as under SQLite
with a bit of configuration and the speedup is always a good thing.
2013-02-26 10:00:14 +01:00
Carl Meyer 6a8f95d812 Fixed a caching test on Python 3. 2013-02-25 18:12:55 -07:00
Łukasz Langa 6a057e1595 Fixed #18191 -- Don't consider Accept-Language redundantly in cache key.
Thanks to choongmin for the original patch.
2013-02-25 16:10:57 -07:00
Aymeric Augustin e76147a83a Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have
the same hash.

Thanks akaariai for the report and regebro for the patch.
2013-02-25 23:05:20 +01:00
Carl Meyer 509798ae06 Use built-in fixture support rather than calling loaddata in setUp(). 2013-02-25 12:13:10 -07:00
Aymeric Augustin 86b96038f2 Merge pull request #847 from fhahn/ticket_18176
Fixed #18176 -- Added test for year lookups with year < 1000
2013-02-25 09:26:56 -08:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Florian Hahn f28c301a47 Fixed #18176 -- Added test for year lookups with year < 1000
Thanks Tomas Ehrlich for the initial test
2013-02-25 17:13:27 +01:00
Claude Paroz 6d52bcbb7c Fixed #19903 -- Fixed unbalanced setUp/tearDown calls in LiveServerAddress test 2013-02-25 08:58:11 +01:00
Aymeric Augustin 7b49da1c38 Changed testing strategy used in 6b03179e.
Avoid polluting the app cache as it causes unrelated test failures.

Refs #19688.
2013-02-25 00:09:13 +01:00
Julien Phalip ae2a8bb456 Fixed a test that was failing in Python 3.
The issue was that as of Python 3, the generators' `next()`
method becomes `__next()`. Thanks Alex Gaynor for noticing that.
Refs #19890.
2013-02-24 13:47:14 -08:00
Julien Phalip a8449d4362 Merge pull request #824 from ambv/languagecode 2013-02-24 12:56:14 -08:00
Simon Charette 6b03179e12 Fixed #19688 -- Allow model subclassing with a custom metaclass using six.with_metaclass 2013-02-24 17:32:34 +01:00
Christopher Medrela 636c45fc58 Fixed #19890 -- ifchanged templatetag rendered its content twice
The content of ifchanged template tag was rendered twice: first time, to
compare it with the previous value and the second time, to return the
rendered output.
2013-02-24 16:49:28 +01:00
Diederik van der Boor 8503120c10 Fixed #15849 -- Made IfChanged node thread safe.
Previously, the ifchanged node stored state on `self._last_seen`,
thereby giving undesired results when the node is reused by another
thread at the same time (e.g. globally caching a Template object).

Thanks to akaihola for the report and Diederik van der Boor and
Bas Peschier for the patch.
2013-02-24 16:06:55 +01:00
Zbigniew Siciarz 0a8402eb05 Test case and docs for custom context data in feeds
Thanks Paul Winkler for the initial patch. (Ref #18112).
2013-02-24 08:33:20 -06:00
Florian Apolloner 4506ae0497 Merge pull request #717 from slurms/ticket_19746
Fixed #19746 -- Allow deserialization of pk-less data
2013-02-24 06:31:14 -08:00
Łukasz Langa 8c8f94fe9d Fixes #19763 - LocaleMiddleware should check for supported languages in settings.LANGUAGE_CODE 2013-02-24 14:43:45 +01:00
Tomek Paczkowski 99edbe0e27 Fixed #19253 -- Extracted template cache key building logic
Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.
2013-02-24 14:32:45 +01:00
Aymeric Augustin 7106a1e594 Merge pull request #819 from erikr/master
Fixed #16302 -- Ensured contrib.comments is IPv6 capable.
2013-02-24 05:02:00 -08:00
Erik Romijn ade992c61e Fixed #16302 -- Ensure contrib.comments is IPv6 capable
Changed the ip_address field for Comment to GenericIPAddressField. Added
instructions to the release notes on how to update the schema of existing
databases.
2013-02-24 13:58:38 +01:00
Bas Peschier 5a9b2bce24 Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL 2013-02-24 13:56:15 +01:00
Wiktor Kolodziej f07a5f0a21 Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
Original patch rewritten, added tests and get_filters_params method for ChangeList class.
Thanks Alex for the report.
2013-02-24 13:23:23 +01:00
Florian Apolloner e4ee3d8fca Fixed a few ResourceWarnings. 2013-02-24 13:11:19 +01:00
Honza Král e4e1287590 Merge pull request #817 from rybaktomasz/ticket_5568
Fixes #5568 -- DROP INDEX subcommand
2013-02-24 04:02:26 -08:00
Honza Kral cbb9f629b8 Revert "fixes #19263" - Fails if not SQLite
This reverts commit 2b76f19f2b.
2013-02-24 12:38:32 +01:00
Tomasz Rybak d7429defe6 Add sqldropindexes to manage
Change patch from https://code.djangoproject.com/ticket/5568
to work on modern Django.
Add special case for MySQL which has different syntax for DROP INDEX.
Add unit tests for the new functionality.
2013-02-24 12:38:28 +01:00
Honza Kral 5a6a4249f3 Removing unneeded tearDown code. 2013-02-24 12:31:00 +01:00
George Song 44164c5c30 Fixed #19896 -- Committed after clearing cache in the database. 2013-02-24 12:15:02 +01:00
Florian Apolloner f56ca3f0e6 Fixed the usage of the deprecated assertEquals. 2013-02-24 11:15:17 +01:00
Aymeric Augustin c10ed58746 Caught warnings in the templates tests. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 10:28:05 +01:00
Honza Král fc38d6a92b Merge pull request #813 from HiddenData/ticket-19263
fixes #19263 - EmptyResultSet in subquery causes incorrect SQL
2013-02-23 15:05:24 -08:00
Marcin Biernat 2b76f19f2b fixes #19263 2013-02-23 23:53:46 +01:00
Honza Král 692902b227 Merge pull request #778 from viciu/19609
Fixed #19609: admin Inlines doesn't display help_text for readonly fields
2013-02-23 14:34:57 -08:00
Honza Kral ef1e6ef1eb Merge branch 'ticket19872' of https://github.com/oinopion/django 2013-02-23 23:32:09 +01:00
Honza Kral 2b48fcc607 Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes 2013-02-23 23:20:34 +01:00
Tomek Paczkowski b88abd6840 Fixed #19872
Made cached_property to behave as property when accessed via class.
2013-02-23 23:20:00 +01:00
Aleksandra Sendecka 32a7ab2148 Fixed #19526
CSS specifications governs that syntax is case insensitive.
This modifies CachedFilesMixin to support that.
2013-02-23 23:05:22 +01:00
Klaas van Schelven 1c11ee6345 Fixed #18829 -- Fixed ModelChoiceIterator length
Thanks facundo.olano at gmail.com for the report and thikonom for
the initial patch.
2013-02-23 22:27:07 +01:00
Alex Gaynor 150e202172 Some style fixes for stuff that was clearly brough tover from doctests. 2013-02-23 13:04:08 -08:00
Honza Král 10026c2ad0 Merge pull request #804 from oinopion/ticket18162
Fixes #18162 --  Specifying choices to Field overrides any form_class argument
2013-02-23 12:45:39 -08:00
Grzegorz Nosek 2cd0edaa47 Fixed 19895 -- Made second iteration over invalid queryset raise an exception too
When iteration over a queryset raised an exception, the result cache
remained initialized with an empty list, so subsequent iterations returned
an empty list instead of raising an exception
2013-02-23 14:35:27 -06:00
Łukasz Langa 539900f117 Fixes #17866: Vary: Accept-Language header when language prefix used 2013-02-23 19:41:33 +01:00
Honza Kral bfd4a71d41 One last final fix for 0ad76843. Tested on py3 and py2 2013-02-23 19:27:37 +01:00
Honza Král 0a341ab40d Merge pull request #791 from khalas/ticket_19811
Changed %r to %s in get_language_info error message
2013-02-23 10:16:23 -08:00
Tomek Paczkowski b6f4a92ff4 Proposed fix for #18162. 2013-02-23 19:01:38 +01:00
Konrad Hałas 48dc0cbf2a Changed %r to %s in get_language_info error message. 2013-02-23 18:54:54 +01:00
Florian Apolloner f368c25f10 Fixed errors introduced in 664855b74e 2013-02-23 18:47:36 +01:00
Florian Apolloner 5ae0c933a8 Fixed errors introduced in 21f333bcef. Refs #17751 2013-02-23 18:43:34 +01:00
Claude Paroz cc53d9b30b Fixed #15877 -- Improved exception when ModelForm has no model class
Thanks theaspect at gmail.com for the report and volrath for the
patch.
2013-02-23 18:32:29 +01:00
Wiktor Kolodziej 67dd54dc84 Fixed #19609: admin Inlines doesn't display help_text for readonly fields
Refactoring: field was renamed to field_name, since flatten_fieldsets returns field name, not field.

Original patch from Marc Aymerich Gubern
2013-02-23 18:24:32 +01:00
Honza Král a05ab448f7 Merge pull request #781 from zsiciarz/ticket_19854
Fixed #19854 -- Added test runner option to skip Selenium tests
2013-02-23 08:55:34 -08:00
Zbigniew Siciarz 1cd2f51eb4 Added test runner option to skip Selenium tests (#19854). 2013-02-23 17:45:26 +01:00
Claude Paroz 335a060fa6 Minor cleanups in templates test imports 2013-02-23 17:45:05 +01:00
Lennart Regebro 687d2e967d Fixed #19827 -- Kept stacktrace in defaulttags exception reraising
Thanks Kronuz for the report and the initial patch.
2013-02-23 17:43:17 +01:00
Honza Král 0ad76843b5 Merge pull request #777 from khalas/ticket_19811
Fixed #19811 - Added language code fallback in get_language_info
2013-02-23 08:30:27 -08:00
Honza Král 129d2e8f85 Merge pull request #775 from HiddenData/ticket-18899
Fixed #18899 -- FileSystemStorage.save should support any file-like objects
2013-02-23 08:04:41 -08:00
Konrad Hałas 6bd6a56896 Fixed #19811 - Added language code fallback in get_language_info. 2013-02-23 17:02:07 +01:00
Aymeric Augustin 5278776a88 Merge pull request #751 from bmispelon/ticket-6271 2013-02-23 07:47:58 -08:00
Marcin Biernat 664855b74e #18899 FileSystemStorage.save should support any file-like objects 2013-02-23 16:40:50 +01:00
Vladimir A Filonov f49e9a517f Fixed #17906 - Autoescaping {% cycle %} and {% firstof %} templatetags.
This commit adds "future" version of these two tags with auto-escaping
enabled.
2013-02-23 16:16:39 +01:00
Tomek Paczkowski 3dddbc0f23 Fixed #19816: pre-evaluate queryset on m2m set
In ReverseManyRelatedObjectsDescriptor.__set__, evaluate possible
queryset to avoid problems when clear() would touch data this queryset
returns.
2013-02-23 15:50:33 +01:00
Baptiste Mispelon 069280a689 Used token.split_contents() for tokenisation in template tags accepting variables.
Fixed #6271, #18260.
2013-02-23 15:15:30 +01:00
Erik Romijn 21f333bcef Fix #17751: Added stripping of whitespace for IPAddressField/GenericIPAddressField 2013-02-23 14:44:57 +01:00
Claude Paroz 7ec2a21be1 Fixed #19686 -- Added HTML5 number input type
Thanks Simon Charette for his help on the patch. Refs #16630.
2013-02-23 10:18:08 +01:00
Anssi Kääriäinen dcf651c27e Fixed Oracle specific failures in commands_sql tests 2013-02-23 01:08:48 +02:00
Anssi Kääriäinen f565c6f999 Marked a test as expected failure. Refs #19884 2013-02-23 00:33:02 +02:00
Anssi Kääriäinen 88c726bea0 Skipped a test on Oracle 2013-02-23 00:33:02 +02:00
Anssi Kääriäinen 09fcb70c80 Fixed empty strings + to_field regression on Oracle
Querying the reverse side of nullable to_field relation, where both
sides can contain null values resulted in incorrect results. The reason
was not detecting '' as NULL.

Refs #17541
2013-02-23 00:05:31 +02:00
Baptiste Mispelon f13bfbec70 Fixed #19882 -- Smarter tokenizing of {% for %} tag arguments. 2013-02-22 19:19:33 +01:00
Anssi Kääriäinen 3c6318e831 Fixed #19870 -- Regression in select_related in inheritance cases
There was a regression in case two models inherited the same parent,
and one contained a foreign key to other. When select_related travelled
the foreign key the other model reused the parent join made by the
first model. This was likely caused by Query.join_parent_model()
addition in commit 68985db482.

Thanks to Trac alias loic84 for report & tests.
2013-02-21 12:01:23 +02:00
Anssi Kääriäinen 50677b29af Made a couple of selenium tests wait for page loaded
The admin_widgets tests were issuing click() to the browser but
didn't wait for the effects of those clicks. This caused the resulting
request to be processed concurrently with the test case. When using
in-memory SQLite this caused weird failures.

Also added wait_page_loaded() to admin selenium tests for code
reuse.

Fixed #19856
2013-02-20 23:56:57 +02:00
Anssi Kääriäinen e8fc3f3783 Added a test for negated Q object querying
The added test is from the patch in ticket #19672 (written by Ian
Kelly). Fixed #19672, refs #19849.
2013-02-20 21:45:36 +02:00
Anssi Kääriäinen edf93127bf Removed join() promote kwarg
The join promote=True was over-aggressive in select_related handling.
After that was removed, the only other user was query.combine(). That
use case is very easy to handle locally, so there is no more need for
the join(promote=True) flag.

Refs #19849.
2013-02-20 21:43:44 +02:00
Anssi Kääriäinen 3fef304ff2 Refactored negated IS NULL handling
This one cleaned up add_filter() negated filter generation. As a side
effect split_exclude() was cleaned up, too.

Refs #19849
2013-02-20 21:34:01 +02:00
Alex Gaynor b55cde054e Added a db_constraint option to ForeignKeys.
This controls whether or not a database level cosntraint is created. This is useful in a few specialized circumstances, but in general should not be used!
2013-02-20 11:27:32 -08:00
Claude Paroz ae2d04f726 Add test for collapsible fieldset functionality in admin 2013-02-20 13:48:49 +01:00
Aymeric Augustin 35c991aa06 Added a default limit to the maximum number of forms in a formset.
This is a security fix. Disclosure and advisory coming shortly.
2013-02-19 11:23:30 -07:00
Carl Meyer 1f39eafd60 Checked object permissions on admin history view.
This is a security fix. Disclosure and advisory coming shortly.

Patch by Russell Keith-Magee.
2013-02-19 11:23:30 -07:00
Carl Meyer c6d69c12ea Restrict the XML deserializer to prevent network and entity-expansion DoS attacks.
This is a security fix. Disclosure and advisory coming shortly.
2013-02-19 11:23:30 -07:00
Carl Meyer d51fb74360 Added a new required ALLOWED_HOSTS setting for HTTP host header validation.
This is a security fix; disclosure and advisory coming shortly.
2013-02-19 11:23:29 -07:00
Anssi Kääriäinen 4b9fa49bc0 Avoided related_name conflicts in tests 2013-02-19 03:13:13 +02:00
Anssi Kääriäinen 607772b942 Removed accidentally committed file 2013-02-19 01:55:40 +02:00
Florian Hahn 3e71368423 Fixed #10870 -- Added aggreation + generic reverse relation test 2013-02-19 01:42:02 +02:00
Anssi Kääriäinen b4492a8ca4 Fixed #19837 -- Refactored split_exclude() join generation
The refactoring mainly concentrates on making sure the inner and outer
query agree about the split position. The split position is where the
multijoin happens, and thus the split position also determines the
columns used in the "WHERE col1 IN (SELECT col2 from ...)" condition.

This commit fixes a regression caused by #10790 and commit
69597e5bcc. The regression was caused
by wrong cols in the split position.
2013-02-19 01:10:49 +02:00
Aymeric Augustin aea98e8c53 Simplified MySQL version checking.
Django used to check the version of MySQL before handling the first
request, which required:
- opening a connection
- closing it, to avoid holding it idle until the first request.

This code isn't necessary any longer since Django dropped support for
some versions of MySQL, and other database backends don't implement a
similar dance. For consistency and maintenability, remove it.

Reverts 4423757c0c.

Closes #18135.
2013-02-18 21:46:26 +01:00
Aymeric Augustin 92837ae569 Avoided firing the request_finished signal in tests.
* Avoided calling BaseHttpResponse.close(). The test client take care of
  that since acc5396e.
* Disconnected the request_finished signal when this method must be
  called. The test client has a similar implementation since bacb097a.
2013-02-18 14:32:45 +01:00
Claude Paroz 632361611c Fixed #19833 -- Fixed import parameter encoding in get_runner
Thanks Danilo Bargen for the report.
2013-02-16 13:31:13 +01:00
Aymeric Augustin e74e207cce Fixed #17260 -- Added time zone aware aggregation and lookups.
Thanks Carl Meyer for the review.

Squashed commit of the following:

commit 4f290bdb60
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 21:21:30 2013 +0100

    Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

    Thanks Ian Kelly for the suggestion.

commit 01b6366f3c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 13:38:43 2013 +0100

    Made tzname a parameter of datetime_extract/trunc_sql.

    This is required to work around a bug in Oracle.

commit 924a144ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 14:47:44 2013 +0100

    Added support for parameters in SELECT clauses.

commit b4351d2890
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 22:30:22 2013 +0100

    Documented backwards incompatibilities in the two previous commits.

commit 91ef84713c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:42:31 2013 +0100

    Used QuerySet.datetimes for the admin's date_hierarchy.

commit 0d0de288a5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:29:38 2013 +0100

    Used QuerySet.datetimes in date-based generic views.

commit 9c0859ff7c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:25 2013 +0100

    Implemented QuerySet.datetimes on Oracle.

commit 68ab511a4f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:14 2013 +0100

    Implemented QuerySet.datetimes on MySQL.

commit 22d52681d3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:42:29 2013 +0100

    Implemented QuerySet.datetimes on SQLite.

commit f6800fd04c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:03 2013 +0100

    Implemented QuerySet.datetimes on PostgreSQL.

commit 0c829c23f4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:41:08 2013 +0100

    Added datetime-handling infrastructure in the ORM layers.

commit 104d82a777
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 10:05:55 2013 +0100

    Updated null_queries tests to avoid clashing with the __second lookup.

commit c01bbb3235
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 23:07:41 2013 +0100

    Updated tests of .dates().

    Replaced .dates() by .datetimes() for DateTimeFields.
    Replaced dates with datetimes in the expected output for DateFields.

commit 50fb7a5246
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:40:09 2013 +0100

    Updated and added tests for QuerySet.datetimes.

commit a8451a5004
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 22:34:46 2013 +0100

    Documented the new time lookups and updated the date lookups.

commit 29413eab2b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 16:15:49 2013 +0100

    Documented QuerySet.datetimes and updated QuerySet.dates.
2013-02-16 09:19:04 +01:00
Claude Paroz b19d83fc12 Improved input sanitizing with thousand separators
For languages with non-breaking space as thousand separator,
standard space input should also be allowed, as few people know
how to enter non-breaking space on keyboards. Refs #17217.
Thanks Alexey Boriskin for the report and initial patch.
2013-02-15 16:37:52 +01:00
Claude Paroz dcf8cd30ae Updated FormattingTests test case to use settings contexts 2013-02-15 09:37:12 +01:00
Julien Phalip 7d5e35cdb4 Fixed #19829 -- Fixed index lookups for NumPy arrays in templates. 2013-02-14 23:29:15 -08:00
Michael van Tellingen 138de533ff Fixed #19819 - Improved template filter errors handling.
Wrap the Parser.compile_filter method call with a try/except and call the
newly added Parser.compile_filter_error(). Overwrite this method in the
DebugParser to throw the correct error.

Since this error was otherwise catched by the compile_function try/except
block the debugger highlighted the wrong line.
2013-02-14 10:22:59 +01:00
Claude Paroz ac4faa6dc3 Fixed #19693 -- Made truncatewords_html handle self-closing tags
Thanks sneawo for the report and Jonathan Loy for the patch.
2013-02-13 18:24:49 +01:00
Hiroki Kiyohara e94f405d94 Fixed #18558 -- Added url property to HttpResponseRedirect*
Thanks coolRR for the report.
2013-02-13 10:29:32 +01:00
Anssi Kääriäinen fafee74306 Removed try-except in django.db.close_connection()
The reason was that the except clause needed to remove a connection
from the django.db.connections dict, but other parts of Django do not
expect this to happen. In addition the except clause was silently
swallowing the exception messages.

Refs #19707, special thanks to Carl Meyer for pointing out that this
approach should be taken.
2013-02-13 00:25:09 +02:00
Nick Sandford 278dad5b41 Fixed #19746 -- Allow deserialization of pk-less data 2013-02-12 17:10:42 +08:00
Simon Charette a10f390804 Fixed #19044 -- Made `DeletionMixin` interpolate its `success_url`.
Thanks to nxvl and slurms for the initial patch, ptone for the review
and timo for the documentation tweaks.
2013-02-11 02:39:14 -05:00
Anssi Kääriäinen 604d8763dc Fixed #19112 -- Reduced the amount of query params in a test 2013-02-10 21:08:19 +02:00
Anssi Kääriäinen 8ef3235034 Fixed #19720 -- Oracle ordering related delete regression
When a query had a complex where condition (a condition targeting more
than the base table) a subquery was used for deletion. However, the
query had default ordering from the model's meta and Oracle doesn't
work with ordered subqueries.

The regression was caused by fast-path deletion code introduced in
1cd6e04cd4 for fixing #18676.

Thanks to Dylan Klomparens for the report.
2013-02-10 19:54:02 +02:00
Anssi Kääriäinen a4e97cf315 Fixed #19707 -- Reset transaction state after requests 2013-02-10 13:55:54 +02:00
Claude Paroz 718afcafc2 Added tests for some sql_* management commands 2013-02-09 16:34:22 +01:00
Claude Paroz f44922c795 Fixed #18906 -- Ignored to-be-deleted forms in formset validate_unique
Thanks c.pollock at bangor.ac.uk for the report.
2013-02-08 21:35:19 +01:00
Julien Phalip db09a2de6e Cleaned up some lingering signals in the test suite that were causing spurious failures with Pypy and Postgres. 2013-02-08 12:12:03 -08:00
Ramiro Morales b5391515cd Changed test assertion strategy used in 04d9730. 2013-02-07 16:51:27 -03:00
Ramiro Morales 04d9730b12 Fixed #13085 -- Don't fail on creation of model with GFK to a model with __len__() returning zero.
Also, according to the comments on the ticket and its duplicates, added
tests execising saving an instance of a model with a GFK to:

* An unsaved object -- This actually doesn't generate the same failure
  but another ORM-level exception. The test verifies it's the case.

* An instance of a model with a __nonzero__() method thant returns False
  for it. This doesn't fail because that code path isn't executed.

* An instance of a model with a CharField PK and an empty value for it.
  This doesn't fail.
2013-02-07 16:05:54 -03:00
Aymeric Augustin 720888a146 Fixed #15808 -- Added optional HttpOnly flag to the CSRF Cookie.
Thanks Samuel Lavitt for the report and Sascha Peilicke for the patch.
2013-02-07 09:48:08 +01:00
Julien Phalip 6afc85af47 Fixed a typo in the test suite that was causing some spurious failures with pypy. 2013-02-06 22:10:13 -08:00
Alexey Boriskin d18f796a48 Fixed #19704 -- Make use of new ungettext_lazy function at appropriate places 2013-02-06 22:01:55 +01:00
Claude Paroz d7504a3d7b Improved regex in strip_tags
Thanks Pablo Recio for the report. Refs #19237.
2013-02-06 21:20:43 +01:00
Simon Charette 5449240c54 Fixed #9800 -- Allow "isPermaLink" attribute in <guid> element of an RSS item.
Thanks @rtnpro for the patch!
2013-02-06 05:28:05 -05:00
Simon Charette a097ee32d8 Fixed #17683 -- Make sure `BaseModelFormSet` respects defined widgets. 2013-02-05 05:39:35 -05:00
Simon Charette ec469ade2b Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 2013-02-05 04:16:07 -05:00
Claude Paroz 40260bc30b Fixed error message test assertions under Python 3.3
Thanks Florian Apolloner for testing.
2013-02-04 18:00:19 +01:00
Claude Paroz 7c5b244826 Fixed #17061 -- Factored out importing object from a dotted path
Thanks Carl Meyer for the report.
2013-02-04 16:38:25 +01:00
Ramiro Morales 869c9ba306 Fixed #19730 -- Don't validate importability of settings by using i18n in management commands.
They are handled independently now and the latter can be influenced by
the new BaseCommand.leave_locale_alone internal option.

Thanks chrischambers for the report, Claude, lpiatek, neaf and gabooo for
their work on a patch, originally on refs. #17379.
2013-02-03 23:40:38 -03:00
Anssi Kääriäinen f556df90be Fixed #19645 -- Added tests for TransactionMiddleware 2013-02-03 16:26:46 +02:00
Julien Phalip bc7a219b1e Fixed Python 3.2 compatibility for a test. 2013-02-02 20:57:38 -08:00
Julien Phalip 293f7a2114 Fixed #17797 -- Enabled support for PATCH requests in the dummy test client. Thanks to pfarmer for the suggestion and initial patch. 2013-02-02 18:22:40 -08:00
Ramiro Morales 08dc90bccf Fixed #14305 -- Switched inspectdb to create unmanaged models.
Thanks Ian Kelly for the report and initial patch.
2013-02-02 21:11:32 -03:00
Nick Sandford 0694d2196f Fixed #19445 -- Skip admin fieldsets validation when the ModelAdmin.get_form() method is overridden. 2013-02-02 14:53:46 -08:00
Aymeric Augustin ace9d4efc3 Made ungettext_lazy usable for messages that do not contain the count.
Fixed #19160 (again). Thanks Alexey Boriskin.
2013-02-02 10:58:31 +01:00
Aymeric Augustin db5049c9f7 Fixed the test introduced in 2ca37af6 under Python 3. 2013-02-02 10:42:01 +01:00
Ramiro Morales 2ca37af621 Added test to demonstrate issue 11387 isn't there anymore.
Thanks adurdin for the report and patch. Fixes #11387.
2013-02-01 23:30:50 -03:00
Ramiro Morales c4b6659269 Added test to demonstrate issue 11263 isn't there anymore.
Thanks veena for the report and jaklaassen for the patch. Fixes #11263.
2013-02-01 23:30:50 -03:00
Claude Paroz 04141c525d Fixed #19663 -- Allowed None in colorize() text parameter
Thanks Jonathan Liuti for the report and the initial patch, and
Simon Charette for the review.
2013-02-01 22:53:18 +01:00
Matt Robenolt 393c268e72 Fixed #19715 -- Simplified findstatic output when verbosity set to 0 2013-02-01 11:55:05 +01:00
Simon Charette 339944491c Renamed inspectdb field names for clarity 2013-02-01 09:16:29 +01:00
Claude Paroz 7bbd17bf20 Fixed #19341 -- Detected NullBooleanField when introspecting models
Thanks Tim Bowden for the report.
2013-01-31 20:55:00 +01:00
Claude Paroz 3c0a81aaf0 Fixed #19709 -- Fixed TimeField introspection on MySQL
Thanks Eugene Grachev for the report.
2013-01-31 20:41:57 +01:00
Claude Paroz eb03fe1642 Added introspection tests for most of Django model fields 2013-01-31 20:41:57 +01:00
Ramiro Morales 7947c9e3a6 Deprecated undocumented warnings manipulation testing tools. 2013-01-31 14:57:45 -03:00
Aymeric Augustin 9a4a1ce323 Fixed #19708 -- Exception in timezone.override(None).
Thanks rafales.
2013-01-31 16:01:50 +01:00
Aymeric Augustin 89cb771be7 Fixed #19692 -- Completed deprecation of mimetype in favor of content_type.
Thanks Tim for the report and initial patch.
2013-01-31 13:54:40 +01:00
Aymeric Augustin 3895ebc734 Added file forgotten in 23e319d7. 2013-01-30 22:11:53 +01:00
Aymeric Augustin 23e319d729 Fixed #19076 -- Added content_type attribute to TemplateView.
Thanks Gavin Wahl.
2013-01-30 21:26:17 +01:00
Aymeric Augustin 3f1a0c0040 Fixed #19160 -- Made lazy plural translations usable.
Many thanks to Alexey Boriskin, Claude Paroz and Julien Phalip.
2013-01-30 20:28:16 +01:00
Ramiro Morales 47ddd6a408 Fixed #19552 -- Enhanced makemessages handling of ``{# #}``-style template comments.
They are simply ignored now. This allows for a more correct behavior when
they are placed before translatable constructs on the same line.

Previously, the latter were wrongly ignored because the former were
preserved when converting template code to the internal Python-syntax
form later fed to xgettext but Python has no ``/* ... */``-style
comments.

Also, special comments directed to translators are now only taken in
account when they are located at the end of a line. e.g.::

  {# Translators: ignored #}{% trans "Literal A" %}{# Translators: valid, associated with "Literal B" below #}
  {% trans "Literal B" %}

Behavior of ``{% comment %}...{% endcomment %}``tags remains unchanged.

Thanks juneih at redpill-linpro dot com for the report and Claude for
his work on the issue.
2013-01-29 19:13:23 -03:00
Tim Graham ee26797cff Fixed typos in docs and comments 2013-01-29 10:55:55 -07:00
Claude Paroz f7394d2c32 Added HTML5 url input type
Refs #16630.
2013-01-28 22:11:00 +01:00
Claude Paroz 4f16376274 Added HTML5 email input type
Refs #16630.
2013-01-28 22:10:50 +01:00
Aymeric Augustin c47fa3b481 Fixed #19676 -- Supported 'self' foreign keys in inspectdb.
Thanks Georgy Kutsurua for the report and Simon Charette for the patch.
2013-01-28 10:21:07 +01:00
Aymeric Augustin f46d7314b5 Fixed #19677 -- Introspection of recursive foreign keys under SQLite.
Thanks Simon Charette.
2013-01-28 10:17:56 +01:00
Claude Paroz 4b3f7110ae Fixed #16123 -- Ensured strptime receive proper string type
strptime generates an UnicodeEncodeError when using a non-ascii
unicode string on Python 2.
2013-01-26 20:53:09 +01:00
Aymeric Augustin 6605ac331a Fixed #17158 -- Used a non-ambiguous representation of SQL queries
when a correct representation cannot be obtained.
2013-01-26 17:51:44 +01:00
Aymeric Augustin 55416e235d Fixed #19589 -- assertRegexpMatches is deprecated in Python 3.3. 2013-01-26 13:47:11 +01:00
Aymeric Augustin 424eb67867 Fixed validation of email addresses when the local part contains an @.
See also BaseUserManager.normalize_email -- it uses rsplit.

Refs #4833.
2013-01-26 12:20:57 +01:00
Claude Paroz ebb504db69 Moved has_changed logic from widget to form field
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-25 20:50:46 +01:00
Ramiro Morales ce27fb198d Revert "Patch by Claude for #16084."
This reverts commit 2babab0bb3.
2013-01-25 13:58:37 -03:00