70 self.assertNotIn('colspan', value) |
70 self.assertNotIn('colspan', value) |
71 |
71 |
72 def test_rql_role_with_vid(self): |
72 def test_rql_role_with_vid(self): |
73 with self.admin_access.web_request() as req: |
73 with self.admin_access.web_request() as req: |
74 context = self.context(req) |
74 context = self.context(req) |
75 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`') |
75 out = rest_publish(context, ':rql:`Any X ORDERBY XL WHERE X is CWUser, X login XL:table`') |
76 self.assertTrue(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" ' |
76 self.assertTrue(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" ' |
77 'title="">anon</a></td></tr>\n</tbody></table>' |
77 'title="">anon</a></td></tr>\n</tbody></table>' |
78 '</div></p>\n')) |
78 '</div></p>\n')) |
79 |
79 |
80 def test_rql_role_with_vid_empty_rset(self): |
80 def test_rql_role_with_vid_empty_rset(self): |
94 out) |
94 out) |
95 |
95 |
96 def test_rql_role_without_vid(self): |
96 def test_rql_role_without_vid(self): |
97 with self.admin_access.web_request() as req: |
97 with self.admin_access.web_request() as req: |
98 context = self.context(req) |
98 context = self.context(req) |
99 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`') |
99 out = rest_publish(context, ':rql:`Any X,XL ORDERBY XL WHERE X is CWUser, X login XL`') |
100 self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">' |
100 self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">' |
101 '<a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a>' |
101 '<a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a>' |
102 '</div><div class="section">' |
102 '</div><div class="section">' |
103 '<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>' |
103 '<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>' |
104 '</div></p>\n') |
104 '</div></p>\n') |
105 |
105 |
106 def test_bookmark_role(self): |
106 def test_bookmark_role(self): |
107 with self.admin_access.web_request() as req: |
107 with self.admin_access.web_request() as req: |
108 context = self.context(req) |
108 context = self.context(req) |
109 rset = req.execute('INSERT Bookmark X: X title "hello", X path ' |
109 rset = req.execute('INSERT Bookmark X: X title "hello", X path ' |
110 '"/view?rql=Any X WHERE X is CWUser"') |
110 '"/view?rql=Any X,XL ORDERBY XL WHERE X is CWUser, X login XL"') |
111 eid = rset[0][0] |
111 eid = rset[0][0] |
112 out = rest_publish(context, ':bookmark:`%s`' % eid) |
112 out = rest_publish(context, ':bookmark:`%s`' % eid) |
113 self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">' |
113 self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section">' |
114 '<a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin' |
114 '<a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin' |
115 '</a></div><div class="section">' |
115 '</a></div><div class="section">' |