mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
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.
This commit is contained in:
parent
6ed6a18a03
commit
088d3bc2f8
19 changed files with 171 additions and 68 deletions
|
@ -23,6 +23,11 @@ Minor features
|
|||
* Authentication backends can raise ``PermissionDenied`` to immediately fail
|
||||
the authentication chain.
|
||||
|
||||
* The ``assertQuerysetEqual()`` now checks for undefined order and raises
|
||||
``ValueError`` if undefined order is spotted. The order is seen as
|
||||
undefined if the given ``QuerySet`` isn't ordered and there are more than
|
||||
one ordered values to compare against.
|
||||
|
||||
Backwards incompatible changes in 1.6
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1770,6 +1770,11 @@ your test suite.
|
|||
via an explicit ``order_by()`` call on the queryset prior to
|
||||
comparison.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
The method now checks for undefined order and raises ``ValueError``
|
||||
if undefined order is spotted. The ordering is seen as undefined if
|
||||
the given ``qs`` isn't ordered and the comparison is against more
|
||||
than one ordered values.
|
||||
|
||||
.. method:: TestCase.assertNumQueries(num, func, *args, **kwargs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue