# HG changeset patch
# User Sylvain Thénault
# Date 1329931322 -3600
# Node ID 25a00e4a8722fa60d8c85684d2a5fc4158083826
# Parent eff5b930998d11c2fcd2f0a00e1a710556487c36
[test] fix ReST extensions tests
diff -r eff5b930998d -r 25a00e4a8722 ext/test/unittest_rest.py
--- a/ext/test/unittest_rest.py Wed Feb 22 09:33:43 2012 +0100
+++ b/ext/test/unittest_rest.py Wed Feb 22 18:22:02 2012 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
@@ -15,9 +15,6 @@
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see .
-"""
-
-"""
from logilab.common.testlib import unittest_main
from cubicweb.devtools.testlib import CubicWebTC
@@ -60,23 +57,23 @@
def test_rql_role_with_vid(self):
context = self.context()
out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`')
- self.assert_(out.endswith('anon'
- '\n\n
\n'))
+ self.assertTrue(out.endswith('anon'
+ '\n\n'))
def test_rql_role_with_vid_empty_rset(self):
context = self.context()
out = rest_publish(context, ':rql:`Any X WHERE X is CWUser, X login "nono":table`')
- self.assert_(out.endswith('No result matching query
\n\n'))
+ self.assertTrue(out.endswith('No result matching query
\n\n'))
def test_rql_role_with_unknown_vid(self):
context = self.context()
out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:toto`')
- self.assert_(out.startswith("an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)
"))
+ self.assertTrue(out.startswith("an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)
"))
def test_rql_role_without_vid(self):
context = self.context()
out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`')
- self.assertEqual(out, u'cwuser_plural
\n')
+ self.assertEqual(out, u'CWUser_plural
\n')
if __name__ == '__main__':
unittest_main()