# HG changeset patch # User Sylvain Thénault # Date 1286529068 -7200 # Node ID b0b0f097a72d7847aa4c107f52b6b4a080eae3c5 # Parent c1a85c1ce131e3e781db1b470f3d149ed69d8d90 cleanups diff -r c1a85c1ce131 -r b0b0f097a72d server/test/unittest_ldapuser.py --- a/server/test/unittest_ldapuser.py Fri Oct 08 07:55:11 2010 +0200 +++ b/server/test/unittest_ldapuser.py Fri Oct 08 11:11:08 2010 +0200 @@ -15,9 +15,7 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""cubicweb.server.sources.ldapusers unit and functional tests - -""" +"""cubicweb.server.sources.ldapusers unit and functional tests""" import socket diff -r c1a85c1ce131 -r b0b0f097a72d sobjects/test/unittest_notification.py --- a/sobjects/test/unittest_notification.py Fri Oct 08 07:55:11 2010 +0200 +++ b/sobjects/test/unittest_notification.py Fri Oct 08 11:11:08 2010 +0200 @@ -58,7 +58,7 @@ def test_nonregr_empty_message_id(self): for eid in (1, 12, 123, 1234): msgid1 = construct_message_id('testapp', eid, 12) - self.assertNotEquals(msgid1, '<@testapp.%s>' % gethostname()) + self.assertNotEqual(msgid1, '<@testapp.%s>' % gethostname()) class RecipientsFinderTC(CubicWebTC): diff -r c1a85c1ce131 -r b0b0f097a72d test/unittest_dbapi.py --- a/test/unittest_dbapi.py Fri Oct 08 07:55:11 2010 +0200 +++ b/test/unittest_dbapi.py Fri Oct 08 11:11:08 2010 +0200 @@ -15,9 +15,8 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -""" +"""unittest for cubicweb.dbapi""" -""" from __future__ import with_statement from copy import copy diff -r c1a85c1ce131 -r b0b0f097a72d test/unittest_entity.py --- a/test/unittest_entity.py Fri Oct 08 07:55:11 2010 +0200 +++ b/test/unittest_entity.py Fri Oct 08 11:11:08 2010 +0200 @@ -317,7 +317,7 @@ def test_printable_value_string(self): e = self.request().create_entity('Card', title=u'rest test', content=u'du :eid:`1:*ReST*`', - content_format=u'text/rest') + content_format=u'text/rest') self.assertEqual(e.printable_value('content'), '

du *ReST*

\n') e.cw_attr_cache['content'] = 'du html users' @@ -393,7 +393,7 @@ self.assertEqual(tidy(e.printable_value('content')), u'R&D;') e.cw_attr_cache['content'] = u'yo !! R&D
pas fermé' self.assertEqual(tidy(e.printable_value('content')), - u'yo !! R&D
pas fermé
') + u'yo !! R&D
pas fermé
') e.cw_attr_cache['content'] = u'été
été' self.assertEqual(tidy(e.printable_value('content')), e.cw_attr_cache['content'] = u'C'est un exemple sérieux' @@ -497,7 +497,7 @@ self.assertEqual(card3.rest_path(), 'card/eid/%d' % card3.eid) card4 = req.create_entity('Card', title=u'pod', wikiid=u'zo?bi') self.assertEqual(card4.rest_path(), 'card/eid/%d' % card4.eid) - + def test_set_attributes(self): req = self.request() diff -r c1a85c1ce131 -r b0b0f097a72d test/unittest_rset.py --- a/test/unittest_rset.py Fri Oct 08 07:55:11 2010 +0200 +++ b/test/unittest_rset.py Fri Oct 08 11:11:08 2010 +0200 @@ -281,7 +281,7 @@ e = rset.get_entity(0, 0) self.assertEqual(e.cw_attr_cache['title'], 'zou') self.assertEqual(pprelcachedict(e._cw_related_cache), - [('created_by_subject', [5])]) + [('created_by_subject', [self.user().eid])]) # first level of recursion u = e.created_by[0] self.assertEqual(u.cw_attr_cache['login'], 'admin') diff -r c1a85c1ce131 -r b0b0f097a72d test/unittest_schema.py --- a/test/unittest_schema.py Fri Oct 08 07:55:11 2010 +0200 +++ b/test/unittest_schema.py Fri Oct 08 11:11:08 2010 +0200 @@ -167,8 +167,7 @@ schema = loader.load(config) self.assert_(isinstance(schema, CubicWebSchema)) self.assertEqual(schema.name, 'data') - entities = [str(e) for e in schema.entities()] - entities.sort() + entities = sorted([str(e) for e in schema.entities()]) expected_entities = ['BaseTransition', 'Bookmark', 'Boolean', 'Bytes', 'Card', 'Date', 'Datetime', 'Decimal', 'CWCache', 'CWConstraint', 'CWConstraintType', 'CWEType', @@ -182,8 +181,7 @@ 'Tag', 'Time', 'Transition', 'TrInfo', 'Workflow', 'WorkflowTransition'] self.assertListEqual(entities, sorted(expected_entities)) - relations = [str(r) for r in schema.relations()] - relations.sort() + relations = sorted([str(r) for r in schema.relations()]) expected_relations = ['add_permission', 'address', 'alias', 'allowed_transition', 'bookmarked_by', 'by_transition', @@ -308,7 +306,7 @@ def test_comparison(self): self.assertEqual(ERQLExpression('X is CWUser', 'X', 0), ERQLExpression('X is CWUser', 'X', 0)) - self.assertNotEquals(ERQLExpression('X is CWUser', 'X', 0), + self.assertNotEqual(ERQLExpression('X is CWUser', 'X', 0), ERQLExpression('X is CWGroup', 'X', 0)) class GuessRrqlExprMainVarsTC(TestCase): diff -r c1a85c1ce131 -r b0b0f097a72d test/unittest_utils.py --- a/test/unittest_utils.py Fri Oct 08 07:55:11 2010 +0200 +++ b/test/unittest_utils.py Fri Oct 08 11:11:08 2010 +0200 @@ -33,8 +33,8 @@ class MakeUidTC(TestCase): def test_1(self): - self.assertNotEquals(make_uid('xyz'), make_uid('abcd')) - self.assertNotEquals(make_uid('xyz'), make_uid('xyz')) + self.assertNotEqual(make_uid('xyz'), make_uid('abcd')) + self.assertNotEqual(make_uid('xyz'), make_uid('xyz')) def test_2(self): d = set() diff -r c1a85c1ce131 -r b0b0f097a72d web/test/unittest_urlpublisher.py --- a/web/test/unittest_urlpublisher.py Fri Oct 08 07:55:11 2010 +0200 +++ b/web/test/unittest_urlpublisher.py Fri Oct 08 11:11:08 2010 +0200 @@ -77,7 +77,7 @@ self.assertEqual(ctrl, 'view') self.assertEqual(len(rset), 1) self.assertEqual(rset.description[0][0], 'CWUser') - self.assertEqual(rset.printable_rql(), 'Any X,AA,AB,AC,AD WHERE X eid 5, X is CWUser, X login AA, X firstname AB, X surname AC, X modification_date AD') + self.assertEqual(rset.printable_rql(), 'Any X,AA,AB,AC,AD WHERE X eid %s, X is CWUser, X login AA, X firstname AB, X surname AC, X modification_date AD' % rset[0][0]) # test non-ascii paths ctrl, rset = self.process('CWUser/login/%C3%BFsa%C3%BFe') self.assertEqual(ctrl, 'view')