'The shortcut view does not catch an AttributeError raised by
the model\'s get_absolute_url() method (#8997).'

def test_shortcut_view_with_broken_get_absolute_url(self):

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