summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils_tests/test_functional.py')
-rw-r--r--tests/utils_tests/test_functional.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index fa23debb4d..8b5c330bcf 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -1,6 +1,5 @@
from django.test import SimpleTestCase
from django.utils.functional import cached_property, classproperty, lazy
-from django.utils.version import PY312
class FunctionalTests(SimpleTestCase):
@@ -133,14 +132,10 @@ class FunctionalTests(SimpleTestCase):
"Cannot assign the same cached_property to two different names ('a' and "
"'b')."
)
- if PY312:
- error_type = TypeError
- msg = type_msg
- else:
- error_type = RuntimeError
- msg = "Error calling __set_name__"
+ error_type = TypeError
+ msg = type_msg
- with self.assertRaisesMessage(error_type, msg) as ctx:
+ with self.assertRaisesMessage(error_type, msg):
class ReusedCachedProperty:
@cached_property
@@ -149,9 +144,6 @@ class FunctionalTests(SimpleTestCase):
b = a
- if not PY312:
- self.assertEqual(str(ctx.exception.__context__), str(TypeError(type_msg)))
-
def test_cached_property_reuse_same_name(self):
"""
Reusing a cached_property on different classes under the same name is