2023-11-24 19:06:29 +08:00
|
|
|
# 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."
|
|
|
|
)
|
2024-08-10 01:03:24 +08:00
|
|
|
with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
|
2023-11-24 19:06:29 +08:00
|
|
|
is_iterable([])
|
2024-08-10 01:03:24 +08:00
|
|
|
self.assertEqual(ctx.filename, __file__)
|