          """
          Testing the `MakeLine` aggregate.
          """
          if not connection.features.supports_make_line_aggr:
              self.assertRaises(
                  NotImplementedError,
                  City.objects.all().aggregate, MakeLine('point')
              )
              return
  
          # MakeLine on an inappropriate field returns simply None
          self.assertIsNone(State.objects.aggregate(MakeLine('poly'))['poly__makeline'])
          # Reference query:
 
</s> remove             self.assertRaises(
                NotImplementedError,
                models.Item.objects.all().aggregate, aggregate('time'))
            self.assertRaises(
                NotImplementedError,
                models.Item.objects.all().aggregate, aggregate('date'))
            self.assertRaises(
                NotImplementedError,
                models.Item.objects.all().aggregate, aggregate('last_modified'))
            self.assertRaises(
                NotImplementedError,
                models.Item.objects.all().aggregate,
                **{'complex': aggregate('last_modified') + aggregate('last_modified')})
 </s> add             with self.assertRaises(NotImplementedError):
                models.Item.objects.all().aggregate(aggregate('time'))
            with self.assertRaises(NotImplementedError):
                models.Item.objects.all().aggregate(aggregate('date'))
            with self.assertRaises(NotImplementedError):
                models.Item.objects.all().aggregate(aggregate('last_modified'))
            with self.assertRaises(NotImplementedError):
                models.Item.objects.all().aggregate(
                    **{'complex': aggregate('last_modified') + aggregate('last_modified')}
                ) </s> remove         self.assertRaises(ValueError, Author.objects.annotate, friends=Count('friends'))
 </s> add         with self.assertRaises(ValueError):
            Author.objects.annotate(friends=Count('friends')) </s> remove         self.assertRaises(NoReverseMatch, reverse, None)
 </s> add         with self.assertRaises(NoReverseMatch):
            reverse(None) </s> remove         self.assertRaises(
            ItalianRestaurant.DoesNotExist,
            lambda: Place.objects.get(name="Demon Dogs").restaurant.italianrestaurant
        )
 </s> add         with self.assertRaises(ItalianRestaurant.DoesNotExist):
            Place.objects.get(name="Demon Dogs").restaurant.italianrestaurant </s> remove         self.assertRaises(AssertionError, method,
                          another_value='another thing')
 </s> add         with self.assertRaises(AssertionError):
            method(another_value='another thing')
            with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point'))
          """
          Testing the `MakeLine` aggregate.
          """
          if not connection.features.supports_make_line_aggr:
            with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point'))
            with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point'))
            with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point'))
            with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point'))
              return
  
          # MakeLine on an inappropriate field returns simply None
          self.assertIsNone(State.objects.aggregate(MakeLine('poly'))['poly__makeline'])
          # Reference query:
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/geoapp/tests.py