61 context = self.context() |
61 context = self.context() |
62 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`') |
62 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`') |
63 self.assert_(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>' |
63 self.assert_(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>' |
64 '</td></tr></tbody></table></div>\n</div>\n</p>\n')) |
64 '</td></tr></tbody></table></div>\n</div>\n</p>\n')) |
65 |
65 |
|
66 def test_rql_role_with_vid_empty_rset(self): |
|
67 context = self.context() |
|
68 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser, X login "nono":table`') |
|
69 self.assert_(out.endswith('<p><div class="searchMessage"><strong>No result matching query</strong></div>\n</p>\n')) |
|
70 |
|
71 def test_rql_role_with_unknown_vid(self): |
|
72 context = self.context() |
|
73 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:toto`') |
|
74 self.assert_(out.startswith("<p>an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)</p>")) |
|
75 |
66 def test_rql_role_without_vid(self): |
76 def test_rql_role_without_vid(self): |
67 context = self.context() |
77 context = self.context() |
68 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`') |
78 out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`') |
69 self.assertEqual(out, u'<p><h1>cwuser_plural</h1><div class="section"><a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a></div><div class="section"><a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a></div></p>\n') |
79 self.assertEqual(out, u'<p><h1>cwuser_plural</h1><div class="section"><a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a></div><div class="section"><a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a></div></p>\n') |
70 |
80 |