[test] cleanup / unittest2 api update stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 08 Oct 2010 07:48:37 +0200
branchstable
changeset 6412 370357e68837
parent 6411 308f6d0e11ae
child 6413 c1a85c1ce131
child 6414 6003dc203567
[test] cleanup / unittest2 api update
hooks/test/unittest_syncschema.py
test/unittest_cwconfig.py
web/test/unittest_views_basecontrollers.py
--- a/hooks/test/unittest_syncschema.py	Fri Oct 08 07:44:22 2010 +0200
+++ b/hooks/test/unittest_syncschema.py	Fri Oct 08 07:48:37 2010 +0200
@@ -15,6 +15,8 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
+"""cubicweb.server.hooks.syncschema unit and functional tests"""
+
 from logilab.common.testlib import TestCase, unittest_main
 
 from cubicweb import ValidationError
--- a/test/unittest_cwconfig.py	Fri Oct 08 07:44:22 2010 +0200
+++ b/test/unittest_cwconfig.py	Fri Oct 08 07:48:37 2010 +0200
@@ -113,7 +113,7 @@
     def test_cubes_path(self):
         # make sure we don't import the email cube, but the stdlib email package
         import email
-        self.assertNotEquals(dirname(email.__file__), self.config.CUBES_DIR)
+        self.assertNotEqual(dirname(email.__file__), self.config.CUBES_DIR)
         self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
         self.assertEqual(self.config.cubes_search_path(),
                           [CUSTOM_CUBES_DIR, self.config.CUBES_DIR])
--- a/web/test/unittest_views_basecontrollers.py	Fri Oct 08 07:44:22 2010 +0200
+++ b/web/test/unittest_views_basecontrollers.py	Fri Oct 08 07:48:37 2010 +0200
@@ -285,26 +285,6 @@
         self.assertItemsEqual(usergroups, ['managers'])
         self.assertEqual(get_pending_deletes(req), [])
 
-    # def test_custom_attribute_handler(self):
-    #     def custom_login_edit(self, formparams, value, relations):
-    #         formparams['login'] = value.upper()
-    #         relations.append('X login %(login)s')
-    #     CWUser.custom_login_edit = custom_login_edit
-    #     try:
-    #         user = self.user()
-    #         eid = repr(user.eid)
-    #         req = self.request()
-    #         req.form = {
-    #             'eid': eid,
-    #             '__type:'+eid:  'CWUser',
-    #             'login:'+eid: u'foo',
-    #             }
-    #         path, params = self.expect_redirect_publish(req, 'edit')
-    #         rset = self.execute('Any L WHERE X eid %(x)s, X login L', {'x': user.eid}, 'x')
-    #         self.assertEqual(rset[0][0], 'FOO')
-    #     finally:
-    #         del CWUser.custom_login_edit
-
     def test_redirect_apply_button(self):
         redirectrql = rql_for_eid(4012) # whatever
         req = self.request()
@@ -323,7 +303,7 @@
         self.failUnless(path.startswith('blogentry/'))
         eid = path.split('/')[1]
         self.assertEqual(params['vid'], 'edition')
-        self.assertNotEquals(int(eid), 4012)
+        self.assertNotEqual(int(eid), 4012)
         self.assertEqual(params['__redirectrql'], redirectrql)
         self.assertEqual(params['__redirectvid'], 'primary')
         self.assertEqual(params['__redirectparams'], 'toto=tutu&tata=titi')