web/test/unittest_viewselector.py
changeset 8696 0bb18407c053
parent 8645 310040c668c0
child 8908 1eefbe171b59
--- a/web/test/unittest_viewselector.py	Thu Feb 14 15:38:25 2013 +0100
+++ b/web/test/unittest_viewselector.py	Thu Feb 14 16:01:24 2013 +0100
@@ -78,11 +78,11 @@
             self.assertEqual(len(content), expected, content)
             return
         try:
-            self.assertSetEqual(content.keys(), expected)
+            self.assertSetEqual(list(content), expected)
         except Exception:
-            print registry, sorted(expected), sorted(content.keys())
-            print 'no more', [v for v in expected if not v in content.keys()]
-            print 'missing', [v for v in content.keys() if not v in expected]
+            print registry, sorted(expected), sorted(content)
+            print 'no more', [v for v in expected if not v in content]
+            print 'missing', [v for v in content if not v in expected]
             raise
 
     def setUp(self):
@@ -486,14 +486,14 @@
 
 
     def test_properties(self):
-        self.assertEqual(sorted(k for k in self.vreg['propertydefs'].keys()
-                                 if k.startswith('ctxcomponents.edit_box')),
-                          ['ctxcomponents.edit_box.context',
-                           'ctxcomponents.edit_box.order',
-                           'ctxcomponents.edit_box.visible'])
-        self.assertEqual([k for k in self.vreg['propertyvalues'].keys()
-                           if not k.startswith('system.version')],
-                          [])
+        self.assertEqual(sorted(k for k in self.vreg['propertydefs'].iterkeys()
+                                if k.startswith('ctxcomponents.edit_box')),
+                         ['ctxcomponents.edit_box.context',
+                          'ctxcomponents.edit_box.order',
+                          'ctxcomponents.edit_box.visible'])
+        self.assertEqual([k for k in self.vreg['propertyvalues'].iterkeys()
+                          if not k.startswith('system.version')],
+                         [])
         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.visible'), True)
         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.order'), 2)
         self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.visible'), False)