          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)
 
</s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = (
            'BookArchive is missing a QuerySet. Define BookArchive.model, '
            'BookArchive.queryset, or override BookArchive.get_queryset().'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = (
            "The named annotation 'authors__age__avg' conflicts with "
            "the default name for another annotation."
        )
        with self.assertRaisesMessage(ValueError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = "The annotation 'friends' conflicts with a field on the model."
        with self.assertRaisesMessage(ValueError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = "The annotation 'age' conflicts with a field on the model."
        with self.assertRaisesMessage(ValueError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = "The annotation 'book_contact_set' conflicts with a field on the model."
        with self.assertRaisesMessage(ValueError, msg):
        msg = (
            'AuthorList is missing a QuerySet. Define AuthorList.model, '
            'AuthorList.queryset, or override AuthorList.get_queryset().'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
          self.assertNotIn('author_list', res.context)
          self.assertTemplateUsed(res, 'generic_views/author_list.html')
  
      def test_missing_items(self):
        msg = (
            'AuthorList is missing a QuerySet. Define AuthorList.model, '
            'AuthorList.queryset, or override AuthorList.get_queryset().'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
              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)
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/generic_views/test_list.py