mirror of
https://github.com/django/django.git
synced 2025-07-09 22:35:19 +00:00
parent
d01709aae2
commit
2e5aa444d1
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue