51 navcomp = self.vreg.select_component('navigation', req, rset) |
51 navcomp = self.vreg.select_component('navigation', req, rset) |
52 html = navcomp.dispatch() |
52 html = navcomp.dispatch() |
53 rset = self.execute('Any RDEF ORDERBY RDEF WHERE RDEF relation_type RT') |
53 rset = self.execute('Any RDEF ORDERBY RDEF WHERE RDEF relation_type RT') |
54 navcomp = self.vreg.select_component('navigation', req, rset) |
54 navcomp = self.vreg.select_component('navigation', req, rset) |
55 html = navcomp.dispatch() |
55 html = navcomp.dispatch() |
56 rset = self.execute('EFRDef RDEF ORDERBY RDEF') |
56 rset = self.execute('CWAttribute RDEF ORDERBY RDEF') |
57 navcomp = self.vreg.select_component('navigation', req, rset) |
57 navcomp = self.vreg.select_component('navigation', req, rset) |
58 html = navcomp.dispatch() |
58 html = navcomp.dispatch() |
59 rset = self.execute('Any RDEF ORDERBY N WHERE RDEF relation_type RT, RT name N') |
59 rset = self.execute('Any RDEF ORDERBY N WHERE RDEF relation_type RT, RT name N') |
60 navcomp = self.vreg.select_component('navigation', req, rset) |
60 navcomp = self.vreg.select_component('navigation', req, rset) |
61 html = navcomp.dispatch() |
61 html = navcomp.dispatch() |
67 |
67 |
68 class ContentNavigationTC(EnvBasedTC): |
68 class ContentNavigationTC(EnvBasedTC): |
69 |
69 |
70 def test_component_context(self): |
70 def test_component_context(self): |
71 view = mock_object(is_primary=lambda x: True) |
71 view = mock_object(is_primary=lambda x: True) |
72 rset = self.execute('EUser X LIMIT 1') |
72 rset = self.execute('CWUser X LIMIT 1') |
73 req = self.request() |
73 req = self.request() |
74 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
74 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
75 view=view, context='navtop') |
75 view=view, context='navtop') |
76 # breadcrumbs should be in headers by default |
76 # breadcrumbs should be in headers by default |
77 clsids = set(obj.id for obj in objs) |
77 clsids = set(obj.id for obj in objs) |
79 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
79 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
80 view=view, context='navbottom') |
80 view=view, context='navbottom') |
81 # breadcrumbs should _NOT_ be in footers by default |
81 # breadcrumbs should _NOT_ be in footers by default |
82 clsids = set(obj.id for obj in objs) |
82 clsids = set(obj.id for obj in objs) |
83 self.failIf('breadcrumbs' in clsids) |
83 self.failIf('breadcrumbs' in clsids) |
84 self.execute('INSERT EProperty P: P pkey "contentnavigation.breadcrumbs.context", ' |
84 self.execute('INSERT CWProperty P: P pkey "contentnavigation.breadcrumbs.context", ' |
85 'P value "navbottom"') |
85 'P value "navbottom"') |
86 # breadcrumbs should now be in footers |
86 # breadcrumbs should now be in footers |
87 req.cnx.commit() |
87 req.cnx.commit() |
88 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
88 objs = self.vreg.possible_vobjects('contentnavigation', req, rset, |
89 view=view, context='navbottom') |
89 view=view, context='navbottom') |