Tutorial 5 (Testing): test_two_past_questions - AssertionError: Lists differ

Hi, I have encountered a difficulty in one of tutorial 5’s automated tests (9 of the 10 tests pass, but this test fails). The test_two_past_questions(self): fails for me with the following error in the command line:

Traceback (most recent call last):
  File "/workspace/pp4-django-blog/poll/tests.py", line 104, in test_two_past_questions
    self.assertQuerysetEqual(
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/test/testcases.py", line 1072, in assertQuerysetEqual
    return self.assertEqual(list(items), values, msg=msg)
AssertionError: Lists differ: [<Question: Past question 1.>, <Question: Past question 2.>] != [<Question: Past question 2.>, <Question: Past question 1.>]

First differing element 0:
<Question: Past question 1.>
<Question: Past question 2.>

- [<Question: Past question 1.>, <Question: Past question 2.>]
?                           ^                             ^

+ [<Question: Past question 2.>, <Question: Past question 1.>]
?                           ^                             ^

The test code I have is pasted below (matches to the tutorial test code):

def test_two_past_questions(self):
        """
        The questions index page may display multiple questions.
        """
        question1 = create_question(question_text="Past question 1.", days=-30)
        question2 = create_question(question_text="Past question 2.", days=-5)
        response = self.client.get(reverse('poll:index'))
        self.assertQuerysetEqual(
            response.context['latest_question_list'],
            [question2, question1],
        )

And when I load my polls page/index.html, it does display multiple questions, so I am not sure how to resolve this

Thanks in advance for any clarifications you may be able to provide

Sorry folks I think i may know what this is - i changed the “order by” in the view to make the questions appear in sequential order (1,2,3) instead of (3,2,1) and i think will almost certainly be the problem, apologies, am just reloading workspace & rechecking now

Yes that fixed it, i needed to just amend the test questions to the below:

question1 = create_question(question_text="Past question 1.", days=-5)
question2 = create_question(question_text="Past question 2.", days=-30)

versus the original:

question1 = create_question(question_text="Past question 1.", days=-30)
question2 = create_question(question_text="Past question 2.", days=-5)

My bad, apologies!