Ticket #7745: 7745-part_b.diff

File 7745-part_b.diff, 1.4 KB (added by Russell Keith-Magee, 16 years ago)

Potential patch for part b of issue report; NOTE: intentional failure in first test

  • tests/regressiontests/utils/datastructures.py

     
    1 """
     1# Python 2.3 doesn't have sorted()
     2try:
     3    sorted
     4except NameError:
     5    from django.utils.itercompat import sorted
     6
     7tests = """
    28>>> from django.utils.datastructures import SortedDict
    39
    410>>> d = SortedDict()
     
    612>>> d[1] = 'one'
    713>>> d[9] = 'nine'
    814>>> d.keys()
    9 [7, 1, 9]
     15[7, 1, 9xxxxxxxx]
    1016>>> d.values()
    1117['seven', 'one', 'nine']
    1218>>> d.items()
     
    4955>>> d.values() # Here the order of SortedDict values *is* what we are testing
    5056['second-two', 'one']
    5157"""
    52 
    53 # Python 2.3 doesn't have sorted()
    54 try:
    55     sorted
    56 except NameError:
    57     from django.utils.itercompat import sorted
    5858       
    59  No newline at end of file
  • tests/regressiontests/utils/tests.py

     
    77from django.utils import html, checksums
    88
    99import timesince
    10 import datastructures
     10from datastructures import tests as datastructures
    1111import itercompat
    1212from decorators import DecoratorFromMiddlewareTests
    1313
Back to Top