          self.assertSequenceEqual(qs, [29])
  
  
  class JoinPromotionTests(TestCase):
      def test_ticket_21150(self):
          b = Bravo.objects.create()
 
</s> remove             options.update({'filter': self.filter})
 </s> add             options['filter'] = self.filter </s> remove     template = '%(function)s(%(distinct)s%(expressions)s)'
 </s> add  </s> remove     def __init__(self, expression, delimiter, distinct=False, **extra):
        distinct = 'DISTINCT ' if distinct else ''
        super().__init__(expression, delimiter=delimiter, distinct=distinct, **extra)
 </s> add     def __init__(self, expression, delimiter, **extra):
        super().__init__(expression, delimiter=delimiter, **extra)
    def test_allow_distinct(self):
        class MyAggregate(Aggregate):
            pass
        with self.assertRaisesMessage(TypeError, 'MyAggregate does not allow distinct'):
            MyAggregate('foo', distinct=True)

        class DistinctAggregate(Aggregate):
            allow_distinct = True
        DistinctAggregate('foo', distinct=True)

          self.assertSequenceEqual(qs, [29])
  
    def test_allow_distinct(self):
        class MyAggregate(Aggregate):
            pass
        with self.assertRaisesMessage(TypeError, 'MyAggregate does not allow distinct'):
            MyAggregate('foo', distinct=True)

        class DistinctAggregate(Aggregate):
            allow_distinct = True
        DistinctAggregate('foo', distinct=True)

  
  class JoinPromotionTests(TestCase):
      def test_ticket_21150(self):
          b = Bravo.objects.create()
keep add keep keep keep keep
 Fixed #28658 -- Added DISTINCT handling to the Aggregate class. 
tests/aggregation_regress/tests.py