'The "depth" argument to select_related() will stop the descent at a
particular level. This can be used on lists as well.'

def test_list_with_depth(self):

    with self.assertNumQueries(5):
        with warnings.catch_warnings():
            warnings.simplefilter(u'ignore', DeprecationWarning)
            world = Species.objects.all().select_related(depth=2)
            orders = [o.genus.family.order.name for o in world]
        self.assertEqual(sorted(orders), [u'Agaricales', u'Diptera', u'Fabales', u'Primates'])
