'Check that we don\'t involve too many copies of the intermediate table when doing a join. Refs #8046, #8254'

def test_join_trimming(self):

    bob = Person.objects.create(name='Bob')
    jim = Person.objects.create(name='Jim')
    rock = Group.objects.create(name='Rock')
    roll = Group.objects.create(name='Roll')
    Membership.objects.create(person=bob, group=rock)
    Membership.objects.create(person=jim, group=rock, price=50)
    Membership.objects.create(person=bob, group=roll, price=50)
    self.assertQuerysetEqual(rock.members.filter(membership__price=50), ['<Person:    Jim>'])
    self.assertQuerysetEqual(bob.group_set.filter(membership__price=50), ['<Group:    Roll>'])
