In polls application I added annotation to check one to many relationship 
between Question and Choice models such that, Index only return questions 
with more than one choices to be displayed but my testcase fails all the 
time with annotation where both query returns same data. (Not Working: Added `annotate(num = 
class IndexView(generic.ListView):
    template_name = 'polls/index.html'
    context_object_name = 'latest_question_list'
    def get_queryset(self):
        """Return the last five published questions."""
        return Question.objects.annotate(num = 
Traceback (most recent call last): File 
"C:\Users\hmnsh\repos\DjangoApp\mysite\polls\", line 80, in 
test_past_question ['']
line 940, in assertQuerysetEqual return self.assertEqual(list(items), 
values, msg=msg) AssertionError: Lists differ: [] != ['']

Please help.

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to