author | Julien Cristau <julien.cristau@logilab.fr> |
Mon, 18 May 2015 19:47:34 +0200 | |
changeset 10445 | f1773842077d |
parent 9848 | ead7a288e08e |
permissions | -rw-r--r-- |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
1 |
# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
5623
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
18 |
"""cubicweb.web.views.navigation unit tests""" |
0 | 19 |
|
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
20 |
from logilab.common.testlib import unittest_main |
5623
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
21 |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2721
diff
changeset
|
22 |
from cubicweb.devtools.testlib import CubicWebTC |
5623
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
23 |
from cubicweb.web.views.navigation import (PageNavigation, SortedNavigation, |
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
24 |
PageNavigationSelect) |
47
54087a269bdd
fix tests (some where broken after ECache was added)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
16
diff
changeset
|
25 |
from cubicweb.web.views.ibreadcrumbs import BreadCrumbEntityVComponent |
0 | 26 |
|
47
54087a269bdd
fix tests (some where broken after ECache was added)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
16
diff
changeset
|
27 |
BreadCrumbEntityVComponent.visible = True |
0 | 28 |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2721
diff
changeset
|
29 |
class NavigationTC(CubicWebTC): |
1723 | 30 |
|
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
31 |
def test_navigation_selection_whatever(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
32 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
33 |
rset = req.execute('Any X,N WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
34 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
35 |
self.assertIsInstance(navcomp, PageNavigation) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
36 |
req.set_search_state('W:X:Y:Z') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
37 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
38 |
self.assertIsInstance(navcomp, PageNavigation) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
39 |
req.set_search_state('normal') |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
40 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
41 |
def test_navigation_selection_ordered(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
42 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
43 |
rset = req.execute('Any X,N ORDERBY N LIMIT 40 WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
44 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset, page_size=20) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
45 |
self.assertIsInstance(navcomp, SortedNavigation) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
46 |
req.set_search_state('W:X:Y:Z') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
47 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset, page_size=20) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
48 |
self.assertIsInstance(navcomp, SortedNavigation) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
49 |
req.set_search_state('normal') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
50 |
navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
51 |
|
5623
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
52 |
def test_navigation_selection_large_rset(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
53 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
54 |
rset = req.execute('Any X,N LIMIT 120 WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
55 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset, page_size=20) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
56 |
self.assertIsInstance(navcomp, PageNavigationSelect) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
57 |
rset = req.execute('Any X,N ORDERBY N LIMIT 120 WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
58 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset, page_size=20) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
59 |
self.assertIsInstance(navcomp, PageNavigationSelect) |
5623
a01aa5b26e66
[test] update test to follow recent navigation/facets fixes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
60 |
|
7000
09e32d10e6bc
[web test] fix test name conflict
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6366
diff
changeset
|
61 |
def test_navigation_selection_not_enough_1(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
62 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
63 |
rset = req.execute('Any X,N LIMIT 10 WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
64 |
navcomp = self.vreg['components'].select_or_none('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
65 |
self.assertEqual(navcomp, None) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
66 |
req.set_search_state('W:X:Y:Z') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
67 |
navcomp = self.vreg['components'].select_or_none('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
68 |
self.assertEqual(navcomp, None) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
69 |
req.set_search_state('normal') |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
70 |
|
7000
09e32d10e6bc
[web test] fix test name conflict
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6366
diff
changeset
|
71 |
def test_navigation_selection_not_enough_2(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
72 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
73 |
rset = req.execute('Any N, COUNT(RDEF) GROUPBY N ORDERBY N ' |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
74 |
'WHERE RDEF relation_type RT, RT name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
75 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
76 |
self.assertIsInstance(navcomp, SortedNavigation) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
77 |
req.set_search_state('W:X:Y:Z') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
78 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
79 |
self.assertIsInstance(navcomp, SortedNavigation) |
1723 | 80 |
|
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
81 |
def test_navigation_selection_wrong_boundary(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
82 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
83 |
rset = req.execute('Any X,N WHERE X name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
84 |
req.form['__start'] = 1000000 |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
85 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
86 |
html = navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
87 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
88 |
def test_sorted_navigation_1(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
89 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
90 |
rset = req.execute('Any RDEF ORDERBY RT WHERE RDEF relation_type RT') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
91 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
92 |
html = navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
93 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
94 |
def test_sorted_navigation_2(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
95 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
96 |
rset = req.execute('Any RDEF ORDERBY RDEF WHERE RDEF relation_type RT') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
97 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
98 |
html = navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
99 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
100 |
def test_sorted_navigation_3(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
101 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
102 |
rset = req.execute('CWAttribute RDEF ORDERBY RDEF') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
103 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
104 |
html = navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
105 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
106 |
def test_sorted_navigation_4(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
107 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
108 |
rset = req.execute('Any RDEF ORDERBY N ' |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
109 |
'WHERE RDEF relation_type RT, RT name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
110 |
navcomp = self.vreg['components'].select('navigation', req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
111 |
html = navcomp.render() |
2676
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
112 |
|
1282a15eb20f
[navigation] split tests, add test for __start out of bound
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2664
diff
changeset
|
113 |
def test_sorted_navigation_5(self): |
9848
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
114 |
with self.admin_access.web_request() as req: |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
115 |
rset = req.execute('Any N, COUNT(RDEF) GROUPBY N ORDERBY N ' |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
116 |
'WHERE RDEF relation_type RT, RT name N') |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
117 |
navcomp = self.vreg['components'].select('navigation', rset.req, rset=rset) |
ead7a288e08e
[webtests/navigation] use the new connection api
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9675
diff
changeset
|
118 |
html = navcomp.render() |
0 | 119 |
|
1723 | 120 |
|
0 | 121 |
|
122 |
if __name__ == '__main__': |
|
123 |
unittest_main() |