diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-12 13:00:18 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-17 11:49:15 +0100 |
commit | 5c10041f4636c3dfe637924ab24da85dd657d790 (patch) | |
tree | 18d7e7628e60a592bf7f74d11a5db4b3a5676b2d /tests/utils_tests | |
parent | e01970e9d23a241473671ea26126f8440db4dead (diff) | |
download | django-5c10041f4636c3dfe637924ab24da85dd657d790.tar.gz |
Refs #30127 -- Removed name argument for django.utils.functional.cached_property().
Per deprecation timeline.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r-- | tests/utils_tests/test_functional.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py index 1e403f351b..23e2eaddcd 100644 --- a/tests/utils_tests/test_functional.py +++ b/tests/utils_tests/test_functional.py @@ -1,8 +1,6 @@ from unittest import mock from django.test import SimpleTestCase -from django.test.utils import ignore_warnings -from django.utils.deprecation import RemovedInDjango50Warning from django.utils.functional import cached_property, classproperty, lazy @@ -108,30 +106,6 @@ class FunctionalTests(SimpleTestCase): for attr in attrs: self.assertCachedPropertyWorks(attr, Class) - @ignore_warnings(category=RemovedInDjango50Warning) - def test_cached_property_name(self): - class Class: - def other_value(self): - """Here is the docstring...""" - return 1, object() - - other = cached_property(other_value, name="other") - other2 = cached_property(other_value, name="different_name") - - self.assertCachedPropertyWorks("other", Class) - # An explicit name is ignored. - obj = Class() - obj.other2 - self.assertFalse(hasattr(obj, "different_name")) - - def test_cached_property_name_deprecation_warning(self): - def value(self): - return 1 - - msg = "The name argument is deprecated as it's unnecessary as of Python 3.6." - with self.assertWarnsMessage(RemovedInDjango50Warning, msg): - cached_property(value, name="other_name") - def test_cached_property_auto_name(self): """ cached_property caches its value and behaves like a property |