On 9/20/07, cesco <[EMAIL PROTECTED]> wrote: > > Thanks for the clarification. > > Basically the view I was trying to test returns a list of list of > querysets and, for some combination of parameters, the queryset is > empty, that is, it returns a list containing an empty list. Shouldn't > the comparison work in that case?
Straight from an IPython shell: In [1]: [[]] == [[]] Out[1]: True So, yes, it should. However, this isn't what your test is doing. perform_search is returning a list of _querysets_ not lists. This _won't_ pass your assertion test, because: Article.objects.all() != [] even if there are no Article objects. You will need to evaluate the queryset to get a list that you can compare in this way: list(Article.objects.all()) == [] Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

