          self.assertEqual(res.context['book'], b)
          self.assertTemplateUsed(res, 'generic_views/book_detail.html')
  
      def test_invalid_url(self):
          self.assertRaises(AttributeError, self.client.get, "/dates/books/2008/oct/01/nopk/")
  
      def test_get_object_custom_queryset(self):
          """
          Ensure that custom querysets are used when provided to
          BaseDateDetailView.get_object()
 
</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(AttributeError, self.client.get, '/detail/author/invalid/url/')
 </s> add         with self.assertRaises(AttributeError):
            self.client.get('/detail/author/invalid/url/') </s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/detail/author/invalid/qs/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/detail/author/invalid/qs/') </s> remove         self.assertRaises(AttributeError, lambda: Book.objects)
 </s> add         with self.assertRaises(AttributeError):
            Book.objects </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')
        with self.assertRaises(AttributeError):
            self.client.get("/dates/books/2008/oct/01/nopk/")
          self.assertEqual(res.context['book'], b)
          self.assertTemplateUsed(res, 'generic_views/book_detail.html')
  
      def test_invalid_url(self):
        with self.assertRaises(AttributeError):
            self.client.get("/dates/books/2008/oct/01/nopk/")
  
      def test_get_object_custom_queryset(self):
          """
          Ensure that custom querysets are used when provided to
          BaseDateDetailView.get_object()
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/generic_views/test_dates.py