The queryset objects will not be identical if they are the result of different queries even if they have the same values in their result (compare ds1.query
and ds2.query
).
If you convert the query set to a list first, you should be able to do a normal comparison (assuming they have the same sort order of course):
self.assertEqual(list(ds1), list(ds2))