web/test/unittest_viewselector.py
changeset 8696 0bb18407c053
parent 8645 310040c668c0
child 8908 1eefbe171b59
equal deleted inserted replaced
8695:358d8bed9626 8696:0bb18407c053
    76             return
    76             return
    77         if registry == 'hooks':
    77         if registry == 'hooks':
    78             self.assertEqual(len(content), expected, content)
    78             self.assertEqual(len(content), expected, content)
    79             return
    79             return
    80         try:
    80         try:
    81             self.assertSetEqual(content.keys(), expected)
    81             self.assertSetEqual(list(content), expected)
    82         except Exception:
    82         except Exception:
    83             print registry, sorted(expected), sorted(content.keys())
    83             print registry, sorted(expected), sorted(content)
    84             print 'no more', [v for v in expected if not v in content.keys()]
    84             print 'no more', [v for v in expected if not v in content]
    85             print 'missing', [v for v in content.keys() if not v in expected]
    85             print 'missing', [v for v in content if not v in expected]
    86             raise
    86             raise
    87 
    87 
    88     def setUp(self):
    88     def setUp(self):
    89         super(VRegistryTC, self).setUp()
    89         super(VRegistryTC, self).setUp()
    90         assert self.vreg['views']['propertiesform']
    90         assert self.vreg['views']['propertiesform']
   484             ):
   484             ):
   485             self._test_view(vid, rql, args)
   485             self._test_view(vid, rql, args)
   486 
   486 
   487 
   487 
   488     def test_properties(self):
   488     def test_properties(self):
   489         self.assertEqual(sorted(k for k in self.vreg['propertydefs'].keys()
   489         self.assertEqual(sorted(k for k in self.vreg['propertydefs'].iterkeys()
   490                                  if k.startswith('ctxcomponents.edit_box')),
   490                                 if k.startswith('ctxcomponents.edit_box')),
   491                           ['ctxcomponents.edit_box.context',
   491                          ['ctxcomponents.edit_box.context',
   492                            'ctxcomponents.edit_box.order',
   492                           'ctxcomponents.edit_box.order',
   493                            'ctxcomponents.edit_box.visible'])
   493                           'ctxcomponents.edit_box.visible'])
   494         self.assertEqual([k for k in self.vreg['propertyvalues'].keys()
   494         self.assertEqual([k for k in self.vreg['propertyvalues'].iterkeys()
   495                            if not k.startswith('system.version')],
   495                           if not k.startswith('system.version')],
   496                           [])
   496                          [])
   497         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.visible'), True)
   497         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.visible'), True)
   498         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.order'), 2)
   498         self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.order'), 2)
   499         self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.visible'), False)
   499         self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.visible'), False)
   500         self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.order'), 10)
   500         self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.order'), 10)
   501         self.assertRaises(UnknownProperty, self.vreg.property_value, 'ctxcomponents.actions_box')
   501         self.assertRaises(UnknownProperty, self.vreg.property_value, 'ctxcomponents.actions_box')