Commit Graph

819 Commits

Author SHA1 Message Date
Simon Charette 6b03179e12 Fixed #19688 -- Allow model subclassing with a custom metaclass using six.with_metaclass 2013-02-24 17:32:34 +01: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
Florian Apolloner e4ee3d8fca Fixed a few ResourceWarnings. 2013-02-24 13:11:19 +01:00
Honza Kral 5a6a4249f3 Removing unneeded tearDown code. 2013-02-24 12:31:00 +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
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
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
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
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
Marcin Biernat 664855b74e #18899 FileSystemStorage.save should support any file-like objects 2013-02-23 16:40:50 +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
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
Nick Sandford 278dad5b41 Fixed #19746 -- Allow deserialization of pk-less data 2013-02-12 17:10:42 +08: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
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
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
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
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
Nick Sandford 93e79b45bc Fixed #17416 -- Added widgets argument to inlineformset_factory and modelformset_factory 2013-01-24 08:58:17 +01:00
Anssi Kääriäinen 7aa538357c Cleaned up testing models.py added for earliest()
The main cleanup was removal of non-necessary __unicode__ method. The
tests didn't break on py3 as the string representation was never used
in the tests.

Refs #17813. Thanks to Simon Charette for spotting this issue.
2013-01-20 08:53:45 +02:00
Nick Sandford fe54377dae Fixed #17813 -- Added a .earliest() method to QuerySet
Thanks a lot to everybody participating in developing this feature.
The patch was developed by multiple people, at least Trac aliases
tonnzor, jimmysong, Fandekasp and slurms.

Stylistic changes added by committer.
2013-01-20 06:39:35 +02:00
Alex Gaynor 984e91e28f Removed some uses of the deprecated assertEquals 2013-01-15 07:51:33 -08:00
David Cramer a7ed09d13d Improve test to ensure that post_delete was actually called 2013-01-14 13:34:55 -08:00
David Cramer 6045efa029 Move signal disconnect into finally block 2013-01-14 13:15:47 -08:00
David Cramer 272de9eb6b Send post_delete signals immediately
In a normal relational construct, if you're listening for an event
that signals a child was deleted, you dont expect that the parent
was deleted already.

This change ensures that post_delete signals are fired immediately
after objects are deleted in the graph.
2013-01-14 13:15:47 -08:00
Claude Paroz 4e2e8f39d1 Fixed #4833 -- Validate email addresses with localhost as domain 2013-01-11 20:45:46 +01:00
Claude Paroz 2e55cf580e Adapted test assertion against yaml dump
Fixes #12914 (again).
2013-01-11 17:52:53 +01:00
Claude Paroz 34ee7d9875 Updated deprecated test assertions 2013-01-08 19:08:15 +01:00
Anssi Kääriäinen 69a46c5ca7 Tests for various emptyqs tickets
The tickets are either about different signature between qs.none() and
qs or problems with subclass types (either EmptyQS overrided the custom
qs class, or EmptyQS was overridden by another class - values() did
this).

Fixed #15959, fixed #17271, fixed #17712, fixed #19426
2013-01-06 19:18:29 +02:00
Anssi Kääriäinen a2396a4c8f Fixed #19173 -- Made EmptyQuerySet a marker class only
The guarantee that no queries will be made when accessing results is
done by new EmptyWhere class which is used for query.where and having.

Thanks to Simon Charette for reviewing and valuable suggestions.
2013-01-06 19:18:28 +02:00
Aymeric Augustin a7b7efe78d Minor fixes in the known_related_objects tests.
* Fixed JSON indentation.
* Avoided relying on implicit ordering.
2013-01-02 22:21:46 +01:00
Aymeric Augustin 07fbc6ae0e Fixed #19547 -- Caching of related instances.
When &'ing or |'ing querysets, wrong values could be cached, and crashes
could happen.

Thanks Marc Tamlyn for figuring out the problem and writing the patch.
2013-01-02 22:21:46 +01:00
Aymeric Augustin 4e5369a596 Silenced warnings in the tests of deprecated features. 2012-12-29 22:32:07 +01:00
Anssi Kääriäinen ba4331f177 Fixed autopk issue in tests 2012-12-29 16:25:24 +02:00
Aymeric Augustin db278c3bf9 Fixed #19525 -- Reverted dcd4383107 and 05d333ba3b.
Refs #9893, #18515.

Thanks Russell for the report.
2012-12-27 09:37:57 +01:00
Ian Clelland 8d35fd4c32 Use new TestCase methods for equality comparisons 2012-12-24 00:24:14 +00:00
Patryk Zawadzki 3989ce52ef Fixed #18172 -- Made models with __iter__ usable in ModelMultipleChoiceField
Thanks to Patryk Zawadzki for the patch.
2012-12-19 22:51:12 +02:00
Anssi Kääriäinen 088d3bc2f8 Fixed #19462 -- Made assertQuerysetEqual detect undefined ordering
If there are more than one values to compare against and the qs isn't
ordered then assertQuerysetEqual will raise a ValueError.
2012-12-13 13:33:11 +02:00
Claude Paroz 6ed6a18a03 Fixed #19432 -- Provided better error message for get_object_or_404
Thanks Kit Sunde for the report and Brian Holdefehr for the initial
patch.
2012-12-12 22:05:00 +01:00
Claude Paroz 8248d14029 Removed US localflavor-specific tests from core
Also fixes #9045.
2012-12-08 21:07:59 +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
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
Aymeric Augustin f89901dc05 Fixed two typos. 2012-11-25 19:31:53 +01: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
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