5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
7 """ |
7 """ |
8 |
8 |
9 from logilab.common.testlib import unittest_main, mock_object |
9 from logilab.common.testlib import unittest_main, mock_object |
10 from cubicweb.devtools.apptest import EnvBasedTC |
10 from cubicweb.devtools.testlib import CubicWebTC |
11 |
11 |
12 from cubicweb.web.views.navigation import PageNavigation, SortedNavigation |
12 from cubicweb.web.views.navigation import PageNavigation, SortedNavigation |
13 from cubicweb.web.views.ibreadcrumbs import BreadCrumbEntityVComponent |
13 from cubicweb.web.views.ibreadcrumbs import BreadCrumbEntityVComponent |
14 |
14 |
15 BreadCrumbEntityVComponent.visible = True |
15 BreadCrumbEntityVComponent.visible = True |
16 |
16 |
17 class NavigationTC(EnvBasedTC): |
17 class NavigationTC(CubicWebTC): |
18 |
18 |
19 def test_navigation_selection_whatever(self): |
19 def test_navigation_selection_whatever(self): |
20 req = self.request() |
20 req = self.request() |
21 rset = self.execute('Any X,N WHERE X name N') |
21 rset = self.execute('Any X,N WHERE X name N') |
22 navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
22 navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
94 navcomp = self.vreg['components'].select('navigation', rset.req, rset=rset) |
94 navcomp = self.vreg['components'].select('navigation', rset.req, rset=rset) |
95 html = navcomp.render() |
95 html = navcomp.render() |
96 |
96 |
97 |
97 |
98 |
98 |
99 class ContentNavigationTC(EnvBasedTC): |
99 class ContentNavigationTC(CubicWebTC): |
100 |
100 |
101 def test_component_context(self): |
101 def test_component_context(self): |
102 view = mock_object(is_primary=lambda x: True) |
102 view = mock_object(is_primary=lambda x: True) |
103 rset = self.execute('CWUser X LIMIT 1') |
103 rset = self.execute('CWUser X LIMIT 1') |
104 req = self.request() |
104 req = self.request() |