'The shortcut view (used for the admin "view on site" functionality)
returns 404 when get_absolute_url is not defined.'

def test_shortcut_view_without_get_absolute_url(self):

    request = HttpRequest()
    request.META = {'SERVER_NAME': 'Example.com', 'SERVER_PORT': '80'}
    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)
