﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19462	Make assertQSEqual error out if no ordering defined	Anssi Kääriäinen	nobody	"An unordered queryset isn't guaranteed to return the values in any order. So, using assertQuerysetEqual comparing more than one value and an unordered qs with the ordered flag set is likely a programming error.

As seen from the linked patch this error is fairly common.

In practice databases usually return the values in insert order, so the error does not surface often. Still, this can be a source of heisenbugs as background database maintenance jobs can alter the ordering of the results.

The linked patch contains two commits, one for making assertQuerysetEqual fail if the ordering isn't well defined, and one to fix all the tests in Django where the ordering isn't well defined.

Patch here: https://github.com/akaariai/django/compare/assertqs_ordering

I guess we need a short mention in release notes about this?"	Cleanup/optimization	closed	Testing framework	dev	Normal	fixed			Accepted	1	0	0	0	0	0
