summaryrefslogtreecommitdiff
path: root/tests/check_framework/test_urls.py
diff options
context:
space:
mode:
author93578237 <43147888+93578237@users.noreply.github.com>2026-02-09 16:06:50 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-10 17:08:13 -0500
commita4999ef1b9790a4c0e793cf0e5c464e9935c3c3a (patch)
treef40aea6d8d811cb1ea3e8babc428debd2d175675 /tests/check_framework/test_urls.py
parente9b85373580338c4878d3f930b52c361398065ad (diff)
[5.2.x] Fixed #36903 -- Fixed further NameErrors when inspecting functions with deferred annotations.
Provide a wrapper for safe introspection of user functions on Python 3.14+. Follow-up to 601914722956cc41f1f2c53972d669ddee6ffc04. Backport of 56ed37e17e5b1a509aa68a0c797dcff34fcc1366 from main.
Diffstat (limited to 'tests/check_framework/test_urls.py')
-rw-r--r--tests/check_framework/test_urls.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/check_framework/test_urls.py b/tests/check_framework/test_urls.py
index a31c5fd856..8931bc75f4 100644
--- a/tests/check_framework/test_urls.py
+++ b/tests/check_framework/test_urls.py
@@ -1,3 +1,5 @@
+import unittest
+
from django.conf import settings
from django.core.checks.messages import Error, Warning
from django.core.checks.urls import (
@@ -10,6 +12,7 @@ from django.core.checks.urls import (
)
from django.test import SimpleTestCase
from django.test.utils import override_settings
+from django.utils.version import PY314
class CheckUrlConfigTests(SimpleTestCase):
@@ -322,6 +325,14 @@ class CheckCustomErrorHandlersTests(SimpleTestCase):
result = check_custom_error_handlers(None)
self.assertEqual(result, [])
+ @unittest.skipUnless(PY314, "Deferred annotations are Python 3.14+ only")
+ @override_settings(
+ ROOT_URLCONF="check_framework.urls.good_error_handler_deferred_annotations",
+ )
+ def test_good_function_based_handlers_deferred_annotations(self):
+ result = check_custom_error_handlers(None)
+ self.assertEqual(result, [])
+
@override_settings(
ROOT_URLCONF="check_framework.urls.good_class_based_error_handlers",
)