test_itercompat.py 549 B

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