﻿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
23654	test_index_view_with_two_past_questions() raising ValueError	skalrynd	nobody	"While following tutorial 5 and executing the test at: https://docs.djangoproject.com/en/1.7/intro/tutorial05/

I got a raised exception:

{{{
Traceback (most recent call last):
  File ""/var/www/project.com/project/polls/tests.py"", line 97, in test_index_view_with_two_past_questions
    ['<Question: Past question 2.>', '<Question: Past question 1.>']
  File ""/usr/local/lib/python3.4/dist-packages/django/test/testcases.py"", line 853, in assertQuerysetEqual
    raise ValueError(""Trying to compare non-ordered queryset ""
ValueError: Trying to compare non-ordered queryset against more than one ordered values
}}}


I found the error to be resolved using list():

{{{
def test_index_view_with_two_past_questions(self):
        """"""
        The questions index page may display multiple questions.
        """"""
        create_question(question_text=""Past question 1."", days=-30)
        create_question(question_text=""Past question 2."", days=-5)
        response = self.client.get(reverse('polls:index'))
        self.assertQuerysetEqual(
            list(response.context['latest_question_list']),
            list(['<Question: Past question 2.>', '<Question: Past question 1.>'])
        )
}}}
"	Uncategorized	closed	Documentation	1.7	Normal	invalid			Unreviewed	0	0	0	0	0	0
