summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_functional.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2019-01-18 10:04:29 -0500
committerTim Graham <timograham@gmail.com>2019-01-30 10:19:48 -0500
commit7e6b214ed34f5562dbd83cf54924a5b589a29715 (patch)
tree2a2aa16c023638436bea449acdb06224bf7f33c7 /tests/utils_tests/test_functional.py
parent5a5c77d55dc85c7e6cf910243257e408887f412a (diff)
Fixed #30116 -- Dropped support for Python 3.5.
Diffstat (limited to 'tests/utils_tests/test_functional.py')
-rw-r--r--tests/utils_tests/test_functional.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index 8d26a906b9..ab649b7983 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -1,8 +1,5 @@
-import unittest
-
from django.test import SimpleTestCase
from django.utils.functional import cached_property, lazy
-from django.utils.version import PY36
class FunctionalTests(SimpleTestCase):
@@ -104,7 +101,6 @@ class FunctionalTests(SimpleTestCase):
for attr in attrs:
self.assertCachedPropertyWorks(attr, Class)
- @unittest.skipUnless(PY36, '__set_name__ is new in Python 3.6')
def test_cached_property_auto_name(self):
"""
cached_property caches its value and behaves like a property
@@ -132,7 +128,6 @@ class FunctionalTests(SimpleTestCase):
obj.other2
self.assertFalse(hasattr(obj, 'different_name'))
- @unittest.skipUnless(PY36, '__set_name__ is new in Python 3.6')
def test_cached_property_reuse_different_names(self):
"""Disallow this case because the decorated function wouldn't be cached."""
with self.assertRaises(RuntimeError) as ctx:
@@ -151,7 +146,6 @@ class FunctionalTests(SimpleTestCase):
))
)
- @unittest.skipUnless(PY36, '__set_name__ is new in Python 3.6')
def test_cached_property_reuse_same_name(self):
"""
Reusing a cached_property on different classes under the same name is
@@ -177,7 +171,6 @@ class FunctionalTests(SimpleTestCase):
self.assertEqual(b.cp, 2)
self.assertEqual(a.cp, 1)
- @unittest.skipUnless(PY36, '__set_name__ is new in Python 3.6')
def test_cached_property_set_name_not_called(self):
cp = cached_property(lambda s: None)
@@ -189,29 +182,6 @@ class FunctionalTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
Foo().cp
- @unittest.skipIf(PY36, '__set_name__ is new in Python 3.6')
- def test_cached_property_mangled_error(self):
- msg = (
- 'cached_property does not work with mangled methods on '
- 'Python < 3.6 without the appropriate `name` argument.'
- )
- with self.assertRaisesMessage(ValueError, msg):
- @cached_property
- def __value(self):
- pass
- with self.assertRaisesMessage(ValueError, msg):
- def func(self):
- pass
- cached_property(func, name='__value')
-
- @unittest.skipIf(PY36, '__set_name__ is new in Python 3.6')
- def test_cached_property_name_validation(self):
- msg = "%s can't be used as the name of a cached_property."
- with self.assertRaisesMessage(ValueError, msg % "'<lambda>'"):
- cached_property(lambda x: None)
- with self.assertRaisesMessage(ValueError, msg % 42):
- cached_property(str, name=42)
-
def test_lazy_equality(self):
"""
== and != work correctly for Promises.