magic-removal: Changed manipulator unit tests to remove usage of sorted() function, which is Python 2.4 only
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d975a92676
commit
f89510c60c
|
@ -88,12 +88,10 @@ Ultimate Ella
|
||||||
datetime.date(2005, 2, 13)
|
datetime.date(2005, 2, 13)
|
||||||
|
|
||||||
# Test follow (inline editing) functionality.
|
# Test follow (inline editing) functionality.
|
||||||
>>> follow = {"albums":True}
|
>>> man = Musician.ChangeManipulator(m1, follow={"albums": True})
|
||||||
>>> man = Musician.ChangeManipulator(m1 ,follow=follow)
|
|
||||||
>>> data = man.flatten_data()
|
>>> data = man.flatten_data()
|
||||||
>>> sorted(data.items(), cmp=lambda x,y: cmp(x[0],y[0]))
|
>>> sorted_list = data.items()
|
||||||
|
>>> sorted_list.sort(lambda x, y: cmp(x[0], y[0]))
|
||||||
|
>>> sorted_list
|
||||||
[('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')]
|
[('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')]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue