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)
Wrap the sql script in a transaction
dataset/ETHPy150Open django/django/tests/contenttypes_tests/test_models.py/ContentTypesTests.test_shortcut_view_with_broken_get_absolute_url--crossover with--dataset/ETHPy150Open coursera/dataduct/dataduct/database/sql/tests/test_sql_script.py/TestSqlScript.test_wrap_transaction