From 088d3bc2f84b6b68fee7e5de053b58049bd110e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Thu, 13 Dec 2012 13:33:11 +0200 Subject: 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. --- docs/releases/1.6.txt | 5 +++++ docs/topics/testing.txt | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'docs') diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index 49649bc6b8..1f57913397 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -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 ===================================== diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index a1524e4f15..a52e4fe169 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -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) -- cgit v1.2.1