﻿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
33762	test_random_ordering not really testing randomization	Sicong	Sicong	"Unit test [https://github.com/django/django/blob/6f73eb9d90cfec684529aab48d517e3d6449ba8c/tests/ordering/tests.py#L235 test_random_ordering] only checks the length of result queryset. It's not checking if order_by(""?"") giving same result every time. 

My proposed solution is like this. It's very unlikely that all 10 items generated with order_by(""?"") are the same. 
{{{
    def test_random_ordering(self):
        """"""
        Use '?' to order randomly.
        """"""
        articles = []
        # Iterate 10 times, items in result set shouldn't be all the same
        for _ in range(10):
            articles.append(list(Article.objects.order_by(""?"")))

        self.assertNotEqual(articles.count(articles[0]), 10)

}}}
"	Cleanup/optimization	closed	Core (Other)		Normal	wontfix			Unreviewed	0	0	0	0	0	0
