          self.assertEqual(Student._meta.ordering, [])
  
          # However, the CommonInfo class cannot be used as a normal model (it
          # doesn't exist as a model).
          self.assertRaises(AttributeError, lambda: CommonInfo.objects.all())
  
      def test_reverse_relation_for_different_hierarchy_tree(self):
          # Even though p.supplier for a Place 'p' (a parent of a Supplier), a
          # Restaurant object cannot access that reverse relation, since it's not
          # part of the Place-Supplier Hierarchy.
 
</s> remove         self.assertRaises(FieldError, Restaurant.objects.filter, supplier__name="foo")
 </s> add         with self.assertRaises(FieldError):
            Restaurant.objects.filter(supplier__name="foo") </s> remove         self.assertRaises(
            Restaurant.DoesNotExist, lambda: p.restaurant
        )
 </s> add         with self.assertRaises(Restaurant.DoesNotExist):
            p.restaurant </s> remove         self.assertRaises(
            DatabaseError,
            lambda: list(Author.objects.all()),
        )
 </s> add         with self.assertRaises(DatabaseError):
            list(Author.objects.all()) </s> remove         self.assertRaises(AttributeError, setattr, self.a, 'full_name', 'Paul McCartney')
 </s> add         with self.assertRaises(AttributeError):
            setattr(self.a, 'full_name', 'Paul McCartney') </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
        with self.assertRaises(AttributeError):
            CommonInfo.objects.all()
          self.assertEqual(Student._meta.ordering, [])
  
          # However, the CommonInfo class cannot be used as a normal model (it
          # doesn't exist as a model).
        with self.assertRaises(AttributeError):
            CommonInfo.objects.all()
  
      def test_reverse_relation_for_different_hierarchy_tree(self):
          # Even though p.supplier for a Place 'p' (a parent of a Supplier), a
          # Restaurant object cannot access that reverse relation, since it's not
          # part of the Place-Supplier Hierarchy.
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/model_inheritance/tests.py