'Check that the shortcut view does not catch an AttributeError raised
by the model\'s get_absolute_url method.
Refs #8997.'

def test_shortcut_view_with_broken_get_absolute_url(self):

    request = HttpRequest()
    request.META = {u'SERVER_NAME': u'Example.com', u'SERVER_PORT': u'80'}
    user_ct = ContentType.objects.get_for_model(FooWithBrokenAbsoluteUrl)
    obj = FooWithBrokenAbsoluteUrl.objects.create(name=u'john')
    self.assertRaises(AttributeError, shortcut, request, user_ct.id, obj.id)
