From f89510c60ca8b6c9a1302174acc7c7daaf8edfdb Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 5 Jan 2006 22:10:41 +0000 Subject: [PATCH] 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 --- tests/modeltests/manipulators/models.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/modeltests/manipulators/models.py b/tests/modeltests/manipulators/models.py index 9b69c5ee80..1dd5615a75 100644 --- a/tests/modeltests/manipulators/models.py +++ b/tests/modeltests/manipulators/models.py @@ -88,12 +88,10 @@ Ultimate Ella datetime.date(2005, 2, 13) # Test follow (inline editing) functionality. ->>> follow = {"albums":True} ->>> man = Musician.ChangeManipulator(m1 ,follow=follow) +>>> man = Musician.ChangeManipulator(m1, follow={"albums": True}) >>> 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')] - - - """