Ticket #7745: 7745-part_b.diff
File 7745-part_b.diff, 1.4 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/utils/datastructures.py
1 """ 1 # Python 2.3 doesn't have sorted() 2 try: 3 sorted 4 except NameError: 5 from django.utils.itercompat import sorted 6 7 tests = """ 2 8 >>> from django.utils.datastructures import SortedDict 3 9 4 10 >>> d = SortedDict() … … 6 12 >>> d[1] = 'one' 7 13 >>> d[9] = 'nine' 8 14 >>> d.keys() 9 [7, 1, 9 ]15 [7, 1, 9xxxxxxxx] 10 16 >>> d.values() 11 17 ['seven', 'one', 'nine'] 12 18 >>> d.items() … … 49 55 >>> d.values() # Here the order of SortedDict values *is* what we are testing 50 56 ['second-two', 'one'] 51 57 """ 52 53 # Python 2.3 doesn't have sorted()54 try:55 sorted56 except NameError:57 from django.utils.itercompat import sorted58 58 59 No newline at end of file -
tests/regressiontests/utils/tests.py
7 7 from django.utils import html, checksums 8 8 9 9 import timesince 10 importdatastructures10 from datastructures import tests as datastructures 11 11 import itercompat 12 12 from decorators import DecoratorFromMiddlewareTests 13 13