diff options
author | Diego Lima <diego.lima@lais.huol.ufrn.br> | 2021-03-06 17:41:24 -0300 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-08 08:22:07 +0100 |
commit | 2e5aa444d140a9f2bc858e493ff85ced589f1a58 (patch) | |
tree | 94d15ebf564a8a58123dbdda3c7727af0305e923 /tests/utils_tests/test_datastructures.py | |
parent | d01709aae21de9cd2565b9c52f32732ea28a2d98 (diff) | |
download | django-2e5aa444d140a9f2bc858e493ff85ced589f1a58.tar.gz |
Fixed #32517 -- Made OrderedSet reversible.
Refs #32516.
Diffstat (limited to 'tests/utils_tests/test_datastructures.py')
-rw-r--r-- | tests/utils_tests/test_datastructures.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/utils_tests/test_datastructures.py b/tests/utils_tests/test_datastructures.py index 45d172f984..465f1864dd 100644 --- a/tests/utils_tests/test_datastructures.py +++ b/tests/utils_tests/test_datastructures.py @@ -1,7 +1,7 @@ """ Tests for stuff in django.utils.datastructures. """ - +import collections.abc import copy import pickle @@ -34,6 +34,11 @@ class OrderedSetTests(SimpleTestCase): s.discard(2) self.assertEqual(len(s), 1) + def test_reversed(self): + s = reversed(OrderedSet([1, 2, 3])) + self.assertIsInstance(s, collections.abc.Iterator) + self.assertEqual(list(s), [3, 2, 1]) + def test_contains(self): s = OrderedSet() self.assertEqual(len(s), 0) |