              ArticleWithAuthor.DoesNotExist,
              c3.get_next_by_pub_date)
          self.assertEqual(c3.get_previous_by_pub_date(), c2)
          self.assertEqual(c2.get_previous_by_pub_date(), c1)
          self.assertRaises(
              ArticleWithAuthor.DoesNotExist,
              c1.get_previous_by_pub_date)
  
      def test_inherited_fields(self):
          """
          Regression test for #8825 and #9390
          Make sure all inherited fields (esp. m2m fields, in this case) appear
 
</s> remove         self.assertRaises(
            ArticleWithAuthor.DoesNotExist,
            c3.get_next_by_pub_date)
 </s> add         with self.assertRaises(ArticleWithAuthor.DoesNotExist):
            c3.get_next_by_pub_date() </s> remove         self.assertRaises(TemplateDoesNotExist, self.client.get, '/render_no_template/')
 </s> add         with self.assertRaises(TemplateDoesNotExist):
            self.client.get('/render_no_template/') </s> remove         self.assertRaises(
            Place.DoesNotExist,
            Place.objects.get,
            pk=ident)
        self.assertRaises(
            ItalianRestaurant.DoesNotExist,
            ItalianRestaurant.objects.get,
            pk=ident)
 </s> add         with self.assertRaises(Place.DoesNotExist):
            Place.objects.get(pk=ident)
        with self.assertRaises(ItalianRestaurant.DoesNotExist):
            ItalianRestaurant.objects.get(pk=ident) </s> remove         self.assertRaises(
            FieldError,
            lambda: Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age'))
        )
 </s> add         with self.assertRaises(FieldError):
            Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age')) </s> remove         self.assertRaises(ValidationError, again.validate_unique)
 </s> add         with self.assertRaises(ValidationError):
            again.validate_unique()
        with self.assertRaises(ArticleWithAuthor.DoesNotExist):
            c1.get_previous_by_pub_date()
              ArticleWithAuthor.DoesNotExist,
              c3.get_next_by_pub_date)
          self.assertEqual(c3.get_previous_by_pub_date(), c2)
          self.assertEqual(c2.get_previous_by_pub_date(), c1)
        with self.assertRaises(ArticleWithAuthor.DoesNotExist):
            c1.get_previous_by_pub_date()
        with self.assertRaises(ArticleWithAuthor.DoesNotExist):
            c1.get_previous_by_pub_date()
        with self.assertRaises(ArticleWithAuthor.DoesNotExist):
            c1.get_previous_by_pub_date()
  
      def test_inherited_fields(self):
          """
          Regression test for #8825 and #9390
          Make sure all inherited fields (esp. m2m fields, in this case) appear
keep keep keep keep replace replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/model_inheritance_regress/tests.py