web/test/unittest_views_navigation.py
changeset 2664 1578e1a57828
parent 2661 f8df42c9da6b
child 2676 1282a15eb20f
equal deleted inserted replaced
2663:2bb628e0cc3b 2664:1578e1a57828
    75 
    75 
    76     def test_component_context(self):
    76     def test_component_context(self):
    77         view = mock_object(is_primary=lambda x: True)
    77         view = mock_object(is_primary=lambda x: True)
    78         rset = self.execute('CWUser X LIMIT 1')
    78         rset = self.execute('CWUser X LIMIT 1')
    79         req = self.request()
    79         req = self.request()
    80         objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
    80         objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
    81                                            view=view, context='navtop')
    81                                            view=view, context='navtop')
    82         # breadcrumbs should be in headers by default
    82         # breadcrumbs should be in headers by default
    83         clsids = set(obj.id for obj in objs)
    83         clsids = set(obj.id for obj in objs)
    84         self.failUnless('breadcrumbs' in clsids)
    84         self.failUnless('breadcrumbs' in clsids)
    85         objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
    85         objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
    86                                           view=view, context='navbottom')
    86                                           view=view, context='navbottom')
    87         # breadcrumbs should _NOT_ be in footers by default
    87         # breadcrumbs should _NOT_ be in footers by default
    88         clsids = set(obj.id for obj in objs)
    88         clsids = set(obj.id for obj in objs)
    89         self.failIf('breadcrumbs' in clsids)
    89         self.failIf('breadcrumbs' in clsids)
    90         self.execute('INSERT CWProperty P: P pkey "contentnavigation.breadcrumbs.context", '
    90         self.execute('INSERT CWProperty P: P pkey "contentnavigation.breadcrumbs.context", '
    91                      'P value "navbottom"')
    91                      'P value "navbottom"')
    92         # breadcrumbs should now be in footers
    92         # breadcrumbs should now be in footers
    93         req.cnx.commit()
    93         req.cnx.commit()
    94         objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
    94         objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
    95                                           view=view, context='navbottom')
    95                                           view=view, context='navbottom')
    96 
    96 
    97         clsids = [obj.id for obj in objs]
    97         clsids = [obj.id for obj in objs]
    98         self.failUnless('breadcrumbs' in clsids)
    98         self.failUnless('breadcrumbs' in clsids)
    99         objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
    99         objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
   100                                           view=view, context='navtop')
   100                                           view=view, context='navtop')
   101 
   101 
   102         clsids = [obj.id for obj in objs]
   102         clsids = [obj.id for obj in objs]
   103         self.failIf('breadcrumbs' in clsids)
   103         self.failIf('breadcrumbs' in clsids)
   104 
   104