def test_inherited_tags_with_prefetch(self):
    child = Child()
    child.save()
    child.tags.add('tag 1', 'tag 2', 'tag 3', 'tag 4')
    child = Child.objects.get()
    no_prefetch_tags = child.tags.all()
    self.assertEquals(4, no_prefetch_tags.count())
    child = Child.objects.prefetch_related('tags').get()
    prefetch_tags = child.tags.all()
    self.assertEquals(4, prefetch_tags.count())
    self.assertEquals(set([t.name for t in no_prefetch_tags]), set([t.name for t in prefetch_tags]))
def test_inherited_tags_with_prefetch(self):
    child = Child()
    child.save()
    child.tags.add('tag 1', 'tag 2', 'tag 3', 'tag 4')
    child = Child.objects.get()
    no_prefetch_tags = child.tags.all()
    self.assertEquals(4, no_prefetch_tags.count())
    child = Child.objects.prefetch_related('tags').get()
    prefetch_tags = child.tags.all()
    self.assertEquals(4, prefetch_tags.count())
    self.assertEquals(set([t.name for t in no_prefetch_tags]), set([t.name for t in prefetch_tags]))