Debian Codegraph @

tests/utils_tests/test_itercompat.py

raw
1 # RemovedInDjango60Warning: Remove this entire module.
2
3 from django.test import SimpleTestCase
4 from django.utils.deprecation import RemovedInDjango60Warning
5 from django.utils.itercompat import is_iterable
6
7
8 class TestIterCompat(SimpleTestCase):
9 def test_is_iterable_deprecation(self):
10 msg = (
11 "django.utils.itercompat.is_iterable() is deprecated. "
12 "Use isinstance(..., collections.abc.Iterable) instead."
13 )
14 with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
15 is_iterable([])
16 self.assertEqual(ctx.filename, __file__)