          self.assertNotIn('author_list', res.context)
          self.assertTemplateUsed(res, 'generic_views/author_list.html')
  
      def test_missing_items(self):
          self.assertRaises(ImproperlyConfigured, self.client.get, '/list/authors/invalid/')
  
      def test_paginated_list_view_does_not_load_entire_table(self):
          # Regression test for #17535
          self._make_authors(3)
          # 1 query for authors
 
</s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/dates/books/invalid/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/dates/books/invalid/') </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(ValueError, City.objects.get, point__exact=htown.point)
 </s> add         with self.assertRaises(ValueError):
            City.objects.get(point__exact=htown.point) </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(forms.ValidationError, fld.to_python, wkt)
 </s> add             with self.assertRaises(forms.ValidationError):
                fld.to_python(wkt)
        with self.assertRaises(ImproperlyConfigured):
            self.client.get('/list/authors/invalid/')
          self.assertNotIn('author_list', res.context)
          self.assertTemplateUsed(res, 'generic_views/author_list.html')
  
      def test_missing_items(self):
        with self.assertRaises(ImproperlyConfigured):
            self.client.get('/list/authors/invalid/')
  
      def test_paginated_list_view_does_not_load_entire_table(self):
          # Regression test for #17535
          self._make_authors(3)
          # 1 query for authors
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/generic_views/test_list.py