Django

Code

Changeset 1831

Show
Ignore:
Timestamp:
01/05/06 16:10:41 (3 years ago)
Author:
adrian
Message:

magic-removal: Changed manipulator unit tests to remove usage of sorted() function, which is Python 2.4 only

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/tests/modeltests/manipulators/models.py

    r1765 r1831  
    8989 
    9090# Test follow (inline editing) functionality. 
    91 >>> follow = {"albums":True} 
    92 >>> man = Musician.ChangeManipulator(m1 ,follow=follow) 
     91>>> man = Musician.ChangeManipulator(m1, follow={"albums": True}) 
    9392>>> data = man.flatten_data() 
    94 >>> sorted(data.items(), cmp=lambda x,y: cmp(x[0],y[0])) 
     93>>> sorted_list = data.items() 
     94>>> sorted_list.sort(lambda x, y: cmp(x[0], y[0])) 
     95>>> sorted_list 
    9596[('album.0.id', 1), ('album.0.name', 'Ella and Basie'), ('album.0.release_date', ''), ('album.1.id', 2), ('album.1.name', 'Ultimate Ella'), ('album.1.release_date', '2005-02-13'), ('first_name', 'Ella'), ('id', 1L), ('last_name', 'Fitzgerald')] 
    96  
    97  
    98  
    9997"""