          }
          user_ct = ContentType.objects.get_for_model(FooWithoutUrl)
          obj = FooWithoutUrl.objects.create(name="john")
  
          self.assertRaises(Http404, shortcut, request, user_ct.id, obj.id)
  
      def test_shortcut_view_with_broken_get_absolute_url(self):
          """
          Check that the shortcut view does not catch an AttributeError raised
          by the model's get_absolute_url method.
 
</s> remove         self.assertRaises(AttributeError, shortcut, request, user_ct.id, obj.id)
 </s> add         with self.assertRaises(AttributeError):
            shortcut(request, user_ct.id, obj.id) </s> remove             self.assertRaises(AttributeError, Book.objects.get, pk=b.pk)
 </s> add             with self.assertRaises(AttributeError):
                Book.objects.get(pk=b.pk) </s> remove         self.assertRaises(TypeError, CustomizableView.as_view, foobar="value")
 </s> add         with self.assertRaises(TypeError):
            CustomizableView.as_view(foobar="value") </s> remove             self.assertRaises(TypeError, SimpleView.as_view, **kwargs)
 </s> add             with self.assertRaises(TypeError):
                SimpleView.as_view(**kwargs) </s> remove             self.assertRaises(AttributeError, b.delete)
 </s> add             with self.assertRaises(AttributeError):
                b.delete()
        with self.assertRaises(Http404):
            shortcut(request, user_ct.id, obj.id)
          }
          user_ct = ContentType.objects.get_for_model(FooWithoutUrl)
          obj = FooWithoutUrl.objects.create(name="john")
  
        with self.assertRaises(Http404):
            shortcut(request, user_ct.id, obj.id)
  
      def test_shortcut_view_with_broken_get_absolute_url(self):
          """
          Check that the shortcut view does not catch an AttributeError raised
          by the model's get_absolute_url method.
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/contenttypes_tests/test_models.py