          StatusPerson.objects.create(name='Bazza Jr.')
          StatusPerson.objects.create(name='Foo Jr.')
          max_id = Person.objects.aggregate(max_id=models.Max('id'))['max_id']
  
          self.assertRaises(
              Person.MultipleObjectsReturned,
              StatusPerson.objects.get,
              id__lt=max_id + 1
          )
  
      def test_abc(self):
          """
          All base classes must be non-abstract
          """
 
</s> remove         self.assertRaises(
            Person.DoesNotExist,
            MyPersonProxy.objects.get,
            name='Zathras'
        )
        self.assertRaises(
            Person.MultipleObjectsReturned,
            MyPersonProxy.objects.get,
            id__lt=max_id + 1
        )
        self.assertRaises(
            Person.DoesNotExist,
            StatusPerson.objects.get,
            name='Zathras'
        )
 </s> add         with self.assertRaises(Person.DoesNotExist):
            MyPersonProxy.objects.get(name='Zathras')
        with self.assertRaises(Person.MultipleObjectsReturned):
            MyPersonProxy.objects.get(id__lt=max_id + 1)
        with self.assertRaises(Person.DoesNotExist):
            StatusPerson.objects.get(name='Zathras') </s> remove         self.assertRaises(TypeError, build_abc)
 </s> add         with self.assertRaises(TypeError):
            build_abc() </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(
            DatabaseError,
            lambda: list(Thing.objects.all()),
        )
 </s> add         with self.assertRaises(DatabaseError):
            list(Thing.objects.all()) </s> remove         self.assertRaises(forms.ValidationError, pnt_fld.clean, 'LINESTRING(0 0, 1 1)')
 </s> add         with self.assertRaises(forms.ValidationError):
            pnt_fld.clean('LINESTRING(0 0, 1 1)')
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
          StatusPerson.objects.create(name='Bazza Jr.')
          StatusPerson.objects.create(name='Foo Jr.')
          max_id = Person.objects.aggregate(max_id=models.Max('id'))['max_id']
  
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
        with self.assertRaises(Person.MultipleObjectsReturned):
            StatusPerson.objects.get(id__lt=max_id + 1)
  
      def test_abc(self):
          """
          All base classes must be non-abstract
          """
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/proxy_models/tests.py