                   .order_by('id')[0:1].get().genus.family.order.name)
              self.assertEqual(s, 'Diptera')
  
      def test_depth_fields_fails(self):
          self.assertRaises(
              TypeError,
              Species.objects.select_related,
              'genus__family__order', depth=4
          )
  
      def test_none_clears_list(self):
          queryset = Species.objects.select_related('genus').select_related(None)
          self.assertEqual(queryset.query.select_related, False)
  
 
</s> remove         self.assertRaises(
            TypeError,
            Article.objects.dates,
        )
 </s> add         with self.assertRaises(TypeError):
            Article.objects.dates() </s> remove         self.assertRaises(
            FieldError,
            lambda: Author.objects.filter(firstname__exact="John")
        )
 </s> add         with self.assertRaises(FieldError):
            Author.objects.filter(firstname__exact="John") </s> remove         self.assertRaises(
            Place.MultipleObjectsReturned,
            Restaurant.objects.get, id__lt=12321
        )
 </s> add         with self.assertRaises(Place.MultipleObjectsReturned):
            Restaurant.objects.get(id__lt=12321) </s> remove         self.assertRaises(
            FieldError,
            lambda: Book.objects.all().aggregate(num_authors=Count('foo'))
        )
 </s> add         with self.assertRaises(FieldError):
            Book.objects.all().aggregate(num_authors=Count('foo')) </s> remove         self.assertRaises(FieldError, list, qs)
        self.assertRaises(FieldError, list, qs)
 </s> add         with self.assertRaises(FieldError):
            list(qs)
        with self.assertRaises(FieldError):
            list(qs)
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
                   .order_by('id')[0:1].get().genus.family.order.name)
              self.assertEqual(s, 'Diptera')
  
      def test_depth_fields_fails(self):
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
        with self.assertRaises(TypeError):
            Species.objects.select_related('genus__family__order', depth=4)
  
      def test_none_clears_list(self):
          queryset = Species.objects.select_related('genus').select_related(None)
          self.assertEqual(queryset.query.select_related, False)
  
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/select_related/tests.py