fix merge, some buffers weren't saved...
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 29 Sep 2010 16:46:47 +0200
changeset 6367 d4c485ec1ca1
parent 6366 1806148d6ce8
child 6368 f907cc7f2875
fix merge, some buffers weren't saved...
test/unittest_rset.py
web/test/unittest_session.py
web/test/unittest_viewselector.py
--- a/test/unittest_rset.py	Wed Sep 29 16:16:32 2010 +0200
+++ b/test/unittest_rset.py	Wed Sep 29 16:46:47 2010 +0200
@@ -155,27 +155,15 @@
         rs.req = self.request()
         rs.vreg = self.vreg
 
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
         rs2 = rs.sorted_rset(lambda e:e.cw_attr_cache['login'])
-        self.assertEquals(len(rs2), 3)
-        self.assertEquals([login for _, login in rs2], ['adim', 'nico', 'syt'])
-=======
-        rs2 = rs.sorted_rset(lambda e:e['login'])
         self.assertEqual(len(rs2), 3)
         self.assertEqual([login for _, login in rs2], ['adim', 'nico', 'syt'])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         # make sure rs is unchanged
         self.assertEqual([login for _, login in rs], ['adim', 'syt', 'nico'])
 
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
         rs2 = rs.sorted_rset(lambda e:e.cw_attr_cache['login'], reverse=True)
-        self.assertEquals(len(rs2), 3)
-        self.assertEquals([login for _, login in rs2], ['syt', 'nico', 'adim'])
-=======
-        rs2 = rs.sorted_rset(lambda e:e['login'], reverse=True)
         self.assertEqual(len(rs2), 3)
         self.assertEqual([login for _, login in rs2], ['syt', 'nico', 'adim'])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         # make sure rs is unchanged
         self.assertEqual([login for _, login in rs], ['adim', 'syt', 'nico'])
 
@@ -196,36 +184,19 @@
                        description=[['CWUser', 'String', 'String']] * 5)
         rs.req = self.request()
         rs.vreg = self.vreg
-
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
         rsets = rs.split_rset(lambda e:e.cw_attr_cache['login'])
-        self.assertEquals(len(rsets), 3)
-        self.assertEquals([login for _, login,_ in rsets[0]], ['adim', 'adim'])
-        self.assertEquals([login for _, login,_ in rsets[1]], ['syt'])
-        self.assertEquals([login for _, login,_ in rsets[2]], ['nico', 'nico'])
-=======
-        rsets = rs.split_rset(lambda e:e['login'])
         self.assertEqual(len(rsets), 3)
         self.assertEqual([login for _, login,_ in rsets[0]], ['adim', 'adim'])
         self.assertEqual([login for _, login,_ in rsets[1]], ['syt'])
         self.assertEqual([login for _, login,_ in rsets[2]], ['nico', 'nico'])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         # make sure rs is unchanged
         self.assertEqual([login for _, login,_ in rs], ['adim', 'adim', 'syt', 'nico', 'nico'])
 
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
         rsets = rs.split_rset(lambda e:e.cw_attr_cache['login'], return_dict=True)
-        self.assertEquals(len(rsets), 3)
-        self.assertEquals([login for _, login,_ in rsets['nico']], ['nico', 'nico'])
-        self.assertEquals([login for _, login,_ in rsets['adim']], ['adim', 'adim'])
-        self.assertEquals([login for _, login,_ in rsets['syt']], ['syt'])
-=======
-        rsets = rs.split_rset(lambda e:e['login'], return_dict=True)
         self.assertEqual(len(rsets), 3)
         self.assertEqual([login for _, login,_ in rsets['nico']], ['nico', 'nico'])
         self.assertEqual([login for _, login,_ in rsets['adim']], ['adim', 'adim'])
         self.assertEqual([login for _, login,_ in rsets['syt']], ['syt'])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         # make sure rs is unchanged
         self.assertEqual([login for _, login,_ in rs], ['adim', 'adim', 'syt', 'nico', 'nico'])
 
@@ -256,25 +227,13 @@
         self.request().create_entity('CWUser', login=u'adim', upassword='adim',
                                      surname=u'di mascio', firstname=u'adrien')
         e = self.execute('Any X,T WHERE X login "adim", X surname T').get_entity(0, 0)
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_attr_cache['surname'], 'di mascio')
+        self.assertEqual(e.cw_attr_cache['surname'], 'di mascio')
         self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'firstname')
         self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'creation_date')
-        self.assertEquals(pprelcachedict(e._cw_related_cache), [])
-=======
-        self.assertEqual(e['surname'], 'di mascio')
-        self.assertRaises(KeyError, e.__getitem__, 'firstname')
-        self.assertRaises(KeyError, e.__getitem__, 'creation_date')
         self.assertEqual(pprelcachedict(e._cw_related_cache), [])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         e.complete()
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_attr_cache['firstname'], 'adrien')
-        self.assertEquals(pprelcachedict(e._cw_related_cache), [])
-=======
-        self.assertEqual(e['firstname'], 'adrien')
+        self.assertEqual(e.cw_attr_cache['firstname'], 'adrien')
         self.assertEqual(pprelcachedict(e._cw_related_cache), [])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
 
     def test_get_entity_advanced(self):
         self.request().create_entity('Bookmark', title=u'zou', path=u'/view')
@@ -282,47 +241,24 @@
         rset = self.execute('Any X,Y,XT,YN WHERE X bookmarked_by Y, X title XT, Y login YN')
 
         e = rset.get_entity(0, 0)
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_row, 0)
-        self.assertEquals(e.cw_col, 0)
-        self.assertEquals(e.cw_attr_cache['title'], 'zou')
-        self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'path')
-        self.assertEquals(e.view('text'), 'zou')
-        self.assertEquals(pprelcachedict(e._cw_related_cache), [])
-=======
         self.assertEqual(e.cw_row, 0)
         self.assertEqual(e.cw_col, 0)
-        self.assertEqual(e['title'], 'zou')
-        self.assertRaises(KeyError, e.__getitem__, 'path')
+        self.assertEqual(e.cw_attr_cache['title'], 'zou')
+        self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'path')
         self.assertEqual(e.view('text'), 'zou')
         self.assertEqual(pprelcachedict(e._cw_related_cache), [])
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
 
         e = rset.get_entity(0, 1)
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_row, 0)
-        self.assertEquals(e.cw_col, 1)
-        self.assertEquals(e.cw_attr_cache['login'], 'anon')
-        self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'firstname')
-        self.assertEquals(pprelcachedict(e._cw_related_cache),
-=======
         self.assertEqual(e.cw_row, 0)
         self.assertEqual(e.cw_col, 1)
-        self.assertEqual(e['login'], 'anon')
-        self.assertRaises(KeyError, e.__getitem__, 'firstname')
+        self.assertEqual(e.cw_attr_cache['login'], 'anon')
+        self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'firstname')
         self.assertEqual(pprelcachedict(e._cw_related_cache),
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
                           [])
         e.complete()
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_attr_cache['firstname'], None)
-        self.assertEquals(e.view('text'), 'anon')
-        self.assertEquals(pprelcachedict(e._cw_related_cache),
-=======
-        self.assertEqual(e['firstname'], None)
+        self.assertEqual(e.cw_attr_cache['firstname'], None)
         self.assertEqual(e.view('text'), 'anon')
         self.assertEqual(pprelcachedict(e._cw_related_cache),
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
                           [])
 
         self.assertRaises(NotAnEntity, rset.get_entity, 0, 2)
@@ -343,32 +279,17 @@
         rset = self.execute('Any X,U,S,XT,UL,SN WHERE X created_by U, U in_state S, '
                             'X title XT, S name SN, U login UL, X eid %s' % e.eid)
         e = rset.get_entity(0, 0)
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(e.cw_attr_cache['title'], 'zou')
-        self.assertEquals(pprelcachedict(e._cw_related_cache),
-=======
-        self.assertEqual(e['title'], 'zou')
+        self.assertEqual(e.cw_attr_cache['title'], 'zou')
         self.assertEqual(pprelcachedict(e._cw_related_cache),
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
                           [('created_by_subject', [5])])
         # first level of recursion
         u = e.created_by[0]
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(u.cw_attr_cache['login'], 'admin')
+        self.assertEqual(u.cw_attr_cache['login'], 'admin')
         self.assertRaises(KeyError, u.cw_attr_cache.__getitem__, 'firstname')
-=======
-        self.assertEqual(u['login'], 'admin')
-        self.assertRaises(KeyError, u.__getitem__, 'firstname')
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
         # second level of recursion
         s = u.in_state[0]
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-        self.assertEquals(s.cw_attr_cache['name'], 'activated')
+        self.assertEqual(s.cw_attr_cache['name'], 'activated')
         self.assertRaises(KeyError, s.cw_attr_cache.__getitem__, 'description')
-=======
-        self.assertEqual(s['name'], 'activated')
-        self.assertRaises(KeyError, s.__getitem__, 'description')
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
 
 
     def test_get_entity_cache_with_left_outer_join(self):
@@ -398,11 +319,7 @@
             etype, n = expected[entity.cw_row]
             self.assertEqual(entity.__regid__, etype)
             attr = etype == 'Bookmark' and 'title' or 'name'
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/test/unittest_rset.py
-            self.assertEquals(entity.cw_attr_cache[attr], n)
-=======
-            self.assertEqual(entity[attr], n)
->>>>>>> /tmp/unittest_rset.py~other.4ZXPmp
+            self.assertEqual(entity.cw_attr_cache[attr], n)
 
     def test_related_entity_optional(self):
         e = self.request().create_entity('Bookmark', title=u'aaaa', path=u'path')
--- a/web/test/unittest_session.py	Wed Sep 29 16:16:32 2010 +0200
+++ b/web/test/unittest_session.py	Wed Sep 29 16:46:47 2010 +0200
@@ -24,16 +24,8 @@
             # fake an incoming http query with sessionid in session cookie
             # don't use self.request() which try to call req.set_session
             req = self.requestcls(self.vreg)
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/web/test/unittest_session.py
             self.assertRaises(InvalidSession, sm.get_session, req, sessionid)
-            self.assertEquals(len(sm._sessions), 0)
-=======
-            websession = sm.get_session(req, sessionid)
-            self.assertEqual(len(sm._sessions), 1)
-            self.assertIs(websession, self.websession)
-            self.assertEqual(websession.sessionid, sessionid)
-            self.assertNotEquals(websession.sessionid, websession.cnx.sessionid)
->>>>>>> /tmp/unittest_session.py~other.sGNH8u
+            self.assertEqual(len(sm._sessions), 0)
         finally:
             # avoid error in tearDown by telling this connection is closed...
             self.cnx._closed = True
--- a/web/test/unittest_viewselector.py	Wed Sep 29 16:16:32 2010 +0200
+++ b/web/test/unittest_viewselector.py	Wed Sep 29 16:46:47 2010 +0200
@@ -467,37 +467,19 @@
 
 
     def test_properties(self):
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/web/test/unittest_viewselector.py
-        self.assertEquals(sorted(k for k in self.vreg['propertydefs'].keys()
+        self.assertEqual(sorted(k for k in self.vreg['propertydefs'].keys()
                                  if k.startswith('ctxcomponents.edit_box')),
                           ['ctxcomponents.edit_box.context',
                            'ctxcomponents.edit_box.order',
                            'ctxcomponents.edit_box.visible'])
-        self.assertEquals([k for k in self.vreg['propertyvalues'].keys()
-=======
-        self.assertEqual(sorted(k for k in self.vreg['propertydefs'].keys()
-                                 if k.startswith('boxes.edit_box')),
-                          ['boxes.edit_box.context',
-                           'boxes.edit_box.order',
-                           'boxes.edit_box.visible'])
         self.assertEqual([k for k in self.vreg['propertyvalues'].keys()
->>>>>>> /tmp/unittest_viewselector.py~other.F5zfDM
                            if not k.startswith('system.version')],
                           [])
-<<<<<<< /home/syt/src/fcubicweb/cubicweb/web/test/unittest_viewselector.py
-        self.assertEquals(self.vreg.property_value('ctxcomponents.edit_box.visible'), True)
-        self.assertEquals(self.vreg.property_value('ctxcomponents.edit_box.order'), 2)
-        self.assertEquals(self.vreg.property_value('ctxcomponents.possible_views_box.visible'), False)
-        self.assertEquals(self.vreg.property_value('ctxcomponents.possible_views_box.order'), 10)
+        self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.visible'), True)
+        self.assertEqual(self.vreg.property_value('ctxcomponents.edit_box.order'), 2)
+        self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.visible'), False)
+        self.assertEqual(self.vreg.property_value('ctxcomponents.possible_views_box.order'), 10)
         self.assertRaises(UnknownProperty, self.vreg.property_value, 'ctxcomponents.actions_box')
-=======
-        self.assertEqual(self.vreg.property_value('boxes.edit_box.visible'), True)
-        self.assertEqual(self.vreg.property_value('boxes.edit_box.order'), 2)
-        self.assertEqual(self.vreg.property_value('boxes.possible_views_box.visible'), False)
-        self.assertEqual(self.vreg.property_value('boxes.possible_views_box.order'), 10)
-        self.assertRaises(UnknownProperty, self.vreg.property_value, 'boxes.actions_box')
->>>>>>> /tmp/unittest_viewselector.py~other.F5zfDM
-