summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2023-11-24 11:06:29 +0000
committerGitHub <noreply@github.com>2023-11-24 12:06:29 +0100
commit5e28cd3f2cfc31bf947a747256bc036f8f64888a (patch)
tree7f687c30cd0bec4aec9837c7b311b616ebd8c4e1 /tests/utils_tests
parenteabfa2d0e38670365aa74117ad2f8710b81065c5 (diff)
Fixed #34983 -- Deprecated django.utils.itercompat.is_iterable().
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_itercompat.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/utils_tests/test_itercompat.py b/tests/utils_tests/test_itercompat.py
new file mode 100644
index 0000000000..e6ea278ab4
--- /dev/null
+++ b/tests/utils_tests/test_itercompat.py
@@ -0,0 +1,15 @@
+# RemovedInDjango60Warning: Remove this entire module.
+
+from django.test import SimpleTestCase
+from django.utils.deprecation import RemovedInDjango60Warning
+from django.utils.itercompat import is_iterable
+
+
+class TestIterCompat(SimpleTestCase):
+ def test_is_iterable_deprecation(self):
+ msg = (
+ "django.utils.itercompat.is_iterable() is deprecated. "
+ "Use isinstance(..., collections.abc.Iterable) instead."
+ )
+ with self.assertWarnsMessage(RemovedInDjango60Warning, msg):
+ is_iterable([])