'The optional fields passed to select_related() control which related
models we pull in. This allows for smaller queries and can act as an
alternative (or, in addition to) the depth parameter.
In this case, we explicitly say to select the \'genus\' and
\'genus.family\' models, leading to the same number of queries as before.'

def test_certain_fields(self):

    world = Species.objects.select_related('genus__family')
    families = [o.genus.family.name for o in world]
    self.assertEqual(sorted(families), ['Amanitacae', 'Drosophilidae', 'Fabaceae', 'Hominidae'])
    self.assertEqual(len(db.connection.queries), 1)
