1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #36005 -- Dropped support for Python 3.10 and 3.11.

This commit is contained in:
Mariusz Felisiak
2025-01-17 22:09:56 +01:00
committed by Sarah Boyce
parent 61dae11df5
commit f5772de696
30 changed files with 79 additions and 266 deletions

View File

@@ -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