'Sum on a distinct() QuerySet should aggregate only the distinct items.'

def test_sum_distinct_aggregate(self):

    authors = Author.objects.filter(book__in=[self.b5, self.b6])
    self.assertEqual(authors.count(), 3)
    distinct_authors = authors.distinct()
    self.assertEqual(distinct_authors.count(), 2)
    age_sum = distinct_authors.aggregate(Sum('age'))
    self.assertEqual(age_sum['age__sum'], 103)
