--- a/web/test/unittest_views_basecontrollers.py Wed Sep 14 09:10:58 2011 +0200
+++ b/web/test/unittest_views_basecontrollers.py Wed Sep 14 09:11:50 2011 +0200
@@ -40,11 +40,11 @@
class EditControllerTC(CubicWebTC):
def setUp(self):
CubicWebTC.setUp(self)
- self.failUnless('users' in self.schema.eschema('CWGroup').get_groups('read'))
+ self.assertTrue('users' in self.schema.eschema('CWGroup').get_groups('read'))
def tearDown(self):
CubicWebTC.tearDown(self)
- self.failUnless('users' in self.schema.eschema('CWGroup').get_groups('read'))
+ self.assertTrue('users' in self.schema.eschema('CWGroup').get_groups('read'))
def test_noparam_edit(self):
"""check behaviour of this controller without any form parameter
@@ -107,7 +107,7 @@
path, params = self.expect_redirect_publish(req, 'edit')
cnx.commit() # commit to check we don't get late validation error for instance
self.assertEqual(path, 'cwuser/user')
- self.failIf('vid' in params)
+ self.assertFalse('vid' in params)
def test_user_editing_itself_no_relation(self):
"""checking we can edit an entity without specifying some required
@@ -308,7 +308,7 @@
'__action_apply': '',
}
path, params = self.expect_redirect_publish(req, 'edit')
- self.failUnless(path.startswith('blogentry/'))
+ self.assertTrue(path.startswith('blogentry/'))
eid = path.split('/')[1]
self.assertEqual(params['vid'], 'edition')
self.assertNotEqual(int(eid), 4012)
@@ -442,7 +442,7 @@
'title-subject:A': u'"13:03:40"',
'content-subject:A': u'"13:03:43"',}
path, params = self.expect_redirect_publish(req, 'edit')
- self.failUnless(path.startswith('blogentry/'))
+ self.assertTrue(path.startswith('blogentry/'))
eid = path.split('/')[1]
e = self.execute('Any C, T WHERE C eid %(x)s, C content T', {'x': eid}).get_entity(0, 0)
self.assertEqual(e.title, '"13:03:40"')
@@ -578,12 +578,12 @@
rset = self.john.as_rset()
rset.req = req
source = ctrl.publish()
- self.failUnless(source.startswith('<?xml version="1.0"?>\n' + STRICT_DOCTYPE +
+ self.assertTrue(source.startswith('<?xml version="1.0"?>\n' + STRICT_DOCTYPE +
u'<div xmlns="http://www.w3.org/1999/xhtml" xmlns:cubicweb="http://www.logilab.org/2008/cubicweb">')
)
req.xhtml_browser = lambda: False
source = ctrl.publish()
- self.failUnless(source.startswith('<div>'))
+ self.assertTrue(source.startswith('<div>'))
# def test_json_exec(self):
# rql = 'Any T,N WHERE T is Tag, T name N'